Find the Bug: A Book of Incorrect Programs

by Addison-Wesley Professional

$34.99
76% off
buy from amazon.com
Average Rating: * * * * -
Sales Rank:783556 (lower is better)
Price as of:11/19/2008 11:07:50 PM MST
Price Used:$7.31
Shipping:Free Shipping on most orders over $25*
Availability:Usually ships in 24 hours
Label:Addison-Wesley Professional
UPC:785342223910
Pages:336
Binding:Paperback
Publication Date:2004-10-16
Published By:Addison-Wesley Professional
ASIN:0321223918
Category:Book

Authors

Editorial Reviews and Product Descriptions

Product Description

Finding bugs and understanding what is really happening within code is a lostart. Only truly good programmers are able to emulate the processor in theirown mind (e.g. read the code and understand how it might work without goingto the trouble of running it). Adam Barr wonders how programmers aresupposed to build better programs if they do not know what is going on incode. The true pursuit of most software programmers is not creatingapplications from scratch; the reality of their day-to-day work is that theyusually have to deal with inherited code. This code, likely written by someoneelse, must be optimized, tweaked, and improved. Therefore, programmers whoare adept at reading, understanding, and improving code are in hot demand.These skills are drawn to the forefront with the help of this new book.This book is language-independent. The author borrows from his extensiveexperience at Microsoft Corporation and as an independent consultant to showhow programming skills can be honed by going through the exercise of findingthe bugs in existing code. By teaching programmers how to troubleshoot, it isthe author's belief that programmers will learn how to think like a programmer,and ultimately produce better software in a more timely fashion.

Customer Reviews

what a waste of money - Reviewed on 2008-11-02
*

Don't buy this book; save a tree!

It says nothing about actually useful practices, like unit-testing. No thrilling bug hunting stories, just a collection of boring examples, written in "for dummies" style that made me want to close the book immediately.
Going from language to language is of dubious benefit - Reviewed on 2005-03-30
* * *
13 customers found this review helpful, 1 did not.

While this book does something that I am in strongly in favor of, I don't agree with the approach. Barr presents a series of code segments that contain bugs and the reader is challenged to find the error(s). The bugs introduced into the code are fairly common, so finding them will be excellent practice for coders at all levels of experience. The segments of code are short, generally less than two pages, so finding the bugs does not require a great deal of searching.
The problem is that the programs are written in C, Python, Java, Perl and x86 assembly. If you are experienced in a particular language, then the bugs will probably not challenge you. However, if you are a novice in a language, the ten pages devoted to introducing the language will not be enough to get you up to speed. I have taught all of these languages and I found it difficult to shift from one language to another. The syntax differences between the languages are enough to confuse even people experienced in all of them. I am also unconvinced that finding bugs in a language you are not using and are unfamiliar with will make you a better programmer.
The general sequence of the bug presentations is:

*) A textual explanation of the problem.
*) The source code.
*) Suggestions of questions to consider.
*) Hints of operations to perform when stepping through the code.
*) Explanation of the bug(s).

Which is certainly a sound approach.
I dithered a bit when trying to settle on a ranking for this book, largely due to the multiple languages. In the end, I settled on three stars because I believe that if you go through this book, it is more likely that instead of doing a few things well, you will do many things poorly.
Interesting brain teasers for coders - Reviewed on 2005-01-10
* * * *
2 customers found this review helpful.

This book has a set of bugs to work through in C, Java, Perl, Python, and Assembler. The bugs range from rudimentary syntax mistakes to more complex and subtle bugs. Hints are given to help you along the way. These will definitely give you brain a spin. Much link the C lint bugs in that have been printed in Dr. Dobbs for years. If you enjoy logic puzzles and bug hunting you will like this book.
Great read! - Reviewed on 2004-11-02
* * * * *
7 customers found this review helpful.

Adam Barr steps you through code analysis in a logical fashion, guiding you around some obvious and not so obvious pitfalls. His writing style makes it easy to understand his concepts. Adam's selection of languages benefits programmers of all backgrounds. I especially enjoyed looking through the Python examples. The language summary at the beginning of each chapter is a great idea to acquaint newcomers to a language. Experienced programmers as well as hobbyists will find great value in the examples. Not only will you become a better debugger, you will become a better programmer.
Great "out of the box" thinking... - Reviewed on 2004-10-31
* * * * *
11 customers found this review helpful, 2 did not.

If you're a programmer who has to look at code that others have written, you'll appreciate this book... Find The Bug by Adam Barr (Addison-Wesley).
Chapter list: Bug Classification; Tips on Walking Through Code; C; Python; Java; Perl; x86 Assembly Language; Classification of Bugs; Index of Bugs by Type; References; Index

This is a excellent text to help you improve your skills on reading code and mentally debugging it. There are 10 short program or routines for each of the five languages. Your goal is to walk through the code and figure out what is the hidden error in it. There are three or four suggestions if you need help thinking it through, a couple of direct hints to focus your thoughts, and a complete explanation at the end. Even though you may not be familiar with some of the languages, Barr gives you a basic coverage of the fundamentals at the beginning of the chapter so that you can see if you are able to spot the error. Add to all that some good information on how best to walk through code, and you end up with a book that should be part of every developer's training. If you're part of a development group that does code walkthroughs, this would be an excellent guide to help everyone become more effective during the process.

A good way to step outside your normal thought processes and improve your skills... good stuff.
Read More Customer Reviews »
Go To Amazon Product Page

* - See Amazon Product Page for shipping and pricing details.


Book Subjects