Chapter 5: Debugging

bug.

b. A defect or fault in a machine, plan, or the like. orig. U.S. 1889 Pall Mall Gaz. 11 Mar. 1/1 Mr. Edison, I was informed, had been up the two previous nights discovering ‘a bug’ in his phonograph—an expression for solving a difficulty, and implying that some imaginary insect has secreted itself inside and is causing all the trouble.

Oxford English Dictionary, 2nd Edition

We have presented a lot of code in the past four chapters, and we’ve pretended that it all pretty much worked the first time. Naturally this wasn’t true; there were plenty of bugs. The word “bug” didn’t originate with programmers, but it is certainly one of the most common terms in computing. Why should software be so hard?

One reason is that the ...

Get The Practice of Programming 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.