50 exercises to sharpen your programming skills, while having a little fun!

The contents of this unique book may be playful, but the underlying point is a serious one: Skilled programmers must be able to examine code—written by themselves or by others—and mentally debug it. Debugging tools will get you only so far; certain errors will sneak past even the best of them. You must become your own best defense against hidden mistakes and nasty surprises. You must find the bug before it finds you.

The book contains 50 programs, in one of five languages (C, Java, Python, Perl, and x86 assembly language). Each program contains a single, hard-to-detect but realistic bug—no tricky gotchas. To find these bugs, you have to think like your processor and anticipate exactly how the code will behave, even without running it. The author provides hints to get you started, as well as any needed language background. He shows you how to analyze programs, and how to uncover their internal logic. In the end, he exposes and explains the bugs.

Practice of this sort not only will improve your debugging skills, but ultimately will help you to write cleaner code in the first place!

Find the Bug is inspired by coding and debugging challenges used by Microsoft in interviewing new programmers. It is an indispensable resource for all working programmers, maintainers, testers, quality specialists, and everyone involved in code reviews.

(c) 2004 Adam Barr