Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
If debugging is the process of removing software bugs, then programming must be the process of putting them in.
I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.
As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.
Building technical systems involves a lot of hard work and specialized knowledge: languages and protocols, coding and debugging, testing and refactoring.
Premature optimization is the root of all evil in programming.
There has never been an unexpectedly short debugging period in the history of computers.
Premature optimization is the root of all evil.
The most frequent complaint is that it's hard. True. it's a hard game to win Also, many people ask me how to use the secret debugging commands, apparently under the impression that I'll tell them.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
The most effective debugging tool is still careful thought, coupled with judiciously placed print statements.
We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.
When debugging, novices insert corrective code; experts remove defective code.
If you're as clever as you can be when you write it, how will you ever debug it?
We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%
To err is human, but to really foul things up you need a computer.
Each new user of a new system uncovers a new class of bugs.
The hardest part of the software task is arriving at a complete and consistent specification, and much of the essence of building a program is in fact the debugging of the specification.
Another effective [debugging] technique is to explain your code to someone else. This will often cause you to explain the bug to yourself. Sometimes it takes no more than a few sentences, followed by an embarrassed "Never mind, I see what's wrong. Sorry to bother you." This works remarkably well; you can even use non-programmers as listeners. One university computer center kept a teddy bear near the help desk. Students with mysterious bugs were required to explain them to the bear before they could speak to a human counselor.
Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.
or simply: