Chapter 11

Debugging

“The difference between the right word and the almost right word is the difference between lightning and a lightning bug.”

—Mark Twain

“L’appétit vient en mangeant.”

—The French

Bugs happen.

Five minutes ago, your code was working perfectly and you swear, all you did was change the color of some object! But now, when the spaceship hits the asteroid, it doesn’t spin any more. But it was totally spinning five minutes ago! And your friend agrees: “Yeah, I saw it spin. That was cool.” The rotate( ) function is there. What happened? It should work. This makes no sense at all! The computer is probably broken. Yeah. Yeah. It is definitely the computer’s fault.

No matter how much time you spend studying computer science, reading ...

Get Learning Processing now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.