5. Programming Techniques

As a developer, most failures you’ll encounter are likely to be associated with the software’s code. One method to find the corresponding fault is to stare the code sternly in the eye—with some help.

Item 38: Review and Manually Execute Suspect Code

You can often pinpoint a bug in an algorithm by examining the code or executing the corresponding lines by hand. You want to verify that the code is written correctly and that your understanding of the code is sound. If you find an error while you examine the code, you’re done. If not, you can then execute the same code with a debugger (see Item 29: “Step through the Code”) and see where you disagree with the computer.

On your first pass through the code, carefully examine ...

Get Effective Debugging: 66 Specific Ways to Debug Software and Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.