From the handyman to the expert reading note 03

Source: Internet
Author: User

The pain of debugging

It is a painful thing: look at your own sorrow, and know that it is not others, but that you are alone.

--Preface

As a software engineering student, I believe that a lot of students and I have the same feeling: that is, the program is written without error, but it is not to debug. As we all know, debugging bugs is a must in every programmer's work, but this process is extremely painful.

We should all have this experience: "

Finally finished!

Run for the first time,

Something went wrong ...

Why is it?

I know what's wrong.

At run time,

It's wrong again ...

And why this time?

It must be OK this time .

Try again

...... "

Haha, see this experience is not particularly want to laugh? In fact, every human-admired programmer must have had this experience. Since 14 "see this sentence, you will also because the debugging has been troubled, or has been irritable? In fact, there is no need, we must learn to adjust the mentality, for many programmers, debugging itself is a sensitive, emotional topic, but if you want to become a good programmer, it is necessary to put the level of mind, rashness, do not debug no matter how many times are not successful under the circumstances are not angry, put down the procedures in hand, Go out to run a few laps mood will be good, come back to continue debugging. I read the "Programmer's path from small to expert" book, the most harvest is the debugging of thinking: Before you start debugging, it is important to choose the right way of thinking, you have to close every day to protect yourself from the many defensive measures, forget you may face any project pressure, and let yourself relax. The most important thing is to remember the first rule of debugging-don't panic. So where do we start? Start viewing bug before Make sure you're working on code that compiles successfully-without warning.

The world of our programming is constantly changing. Today is probably the best technology, and it's out of date tomorrow. We can never write the perfect code, because the standard of evaluation is also increasing with the progress of the Times. No matter how perfect the code we write now seems to be, it is likely that it will soon be the object of ridicule. So we need to constantly learn, innovate, and constantly enhance their skills, especially the ability to debug. First, we try not to rely on debug tools when writing java programs , such as the debugger that comes with Eclipse . . In my experience of writing code, it is only necessary to use the Debug tool when writing C+ + code when it encounters an error . then, when we write unit tests, if a piece of code consists of a bunch of unverified functions, it's hard to debug. There is also the need to improve our design capabilities, usually good design easier to debug. The last point is to write more practice, as the saying goes: Qinnengbuzhuo, clumsy birds have or reasonable!



From the handyman to the expert reading note 03

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.