4 ms·
> K: I don't use fancy debuggers, I use print statements and I don't use a debugger for anything more than getting a stack trace when the program dies unexpecte
by krat0sprakhar 11y ago
> K: I don't use fancy debuggers, I use print statements and I don't use a debugger for anything more than getting a stack trace when the program dies unexpectedly.
Ha! Who would've thought that the author of so many books on software engineering prefers using print statements for debugging. Great interview!
- cremno 11y agoFrom “UNIX For Beginners” (2nd ed., 1979) written by him: >The most effective debugging tool is still careful thought, coupled with judiciously placed print statements. However the previous sentence is: >The debugger adb is useful for digging through the dead bodies of C programs, but is rather hard to learn to use effectively.
- weland 11y agoIt has an added, important advantage: it allows you to examine program flow without interrupting it. Sometimes that's outright essential (e.g. you're debugging ISRs and breakpoints screw up everything; you can't printf from an ISR, obviously, but you can at least toggle some signal to examine on a logic analyser or flip a flag that you print back in the main loop); other times it's just easier to see where the difference between "what you wrote" and "what you think you wrote" is when you can follow the program's output as it's running, rather than through a sequence of breakpoints.