Skip to content

Bugs

The term bug is used to describe an error in your program that makes it produce incorrect results.

Debugging is the process of finding the bugs in your program and fixing them.

  • The compiler will catch bugs in your code's syntax.

  • You have to find bugs in your code's logic.

Practice Exercise

Why "Bug?"

Back in 1947, when computers were as much mechanical as electronic, a computer at a Naval research station started producing incorrect results. A technician started looking through the maze of relays, switches and vacuum tubes, and found that a moth had made its way into the computer's circuitry, become caught in one of the relays and had died. This caused the relay to work incorrectly. When they "debugged" the computer — when they took the bug out — it started working correctly again. They taped the moth in the logbook with the entry "First actual case of bug being found." (The term "bug" for a mechanical or design defect had been in use at least since the days of Thomas Edison.)


Prev -- Up -- Next