Previous Up Next

Buy this book at

This HTML version of the book is provided as a convenience, but some math equations are not translated correctly. The PDF version is more reliable.

Chapter 15  The Nine Theorems of Debugging

  1. Readable code is debuggable code.
  2. The only thing worse than getting an error message is not getting an error message.
  3. You must always be 100% sure that the code you are running is the code you think you are running.
  4. Error messages tell you where the problem was discovered, not where it was caused.
  5. The best kind of debugging is the kind you don’t have to do.
  6. The worst bugs aren’t in your code; they are in your head.
  7. The best way to avoid a bug is to make it impossible.
  8. Error messages sometimes tell you what’s wrong, but they seldom tell you what to do (and when they try, they’re usually wrong).
  9. Finding a hard bug requires reading, running, ruminating, and sometimes retreating. If you get stuck on one of these activities, try the others.

Are you using one of our books in a class?

We'd like to know about it. Please consider filling out this short survey.

Think Bayes

Think Python 2e

Think Stats 2e

Think Complexity

Previous Up Next