![]() |
Chapter 5 | ![]() |
The second best thing to the real thing; using logs and printing messages to the console to identify a bug in your code. This is usually the first form of investigation performed by a beginning programmer. Most of debugging is simply identifying the bug - most bugs are quickly and easily fixed. If tracing the code didn't show you an obvious problem, you will have to start getting your hands dirty
There are several different variations on how this is performed, and as the examples become more advanced, you should quickly see why most programmers prefer an easier method - using GDB or a similar debugger. Keep in mind that the short time spent learning any debuygger's commands will result in literally hundreds of hours of time saved debugging. Speaking as a professional programmer who has logged thousands of hours in front of nasty piles of steaming code, a real debugger is like a tree-shaped evergreen-scented odor-eater with the glitter of justice in it's eyes.
![]() |
Index | ![]() |
4.3 Tracing the Thread of Execution | 5.2 Simple Bugs, Simple Logs. |