Why print-based debugging is so popularA recent ONLamp article on the Python debugger included the line:
This sparked an insight about why In debugging the most important thing is to look backwards in time, because you are trying to answer the question 'how did I get into this pinch?' Print-based debugging builds up information about the history of your program as it arrives at the fatal point. All the information you print or log creates a trace record that you can then walk backwards, determining the relevant bit of your program's past state. By contrast, debuggers have historically spent a lot of effort on moving forward in time (single-step, continue to next breakpoint, and so on) and relatively little effort on sophisticated ways of examining program state. If you want to trace your program's evolving state in a debugger, usually what you wind up doing is inserting print commands in a language that's worse and more awkward than the one your program is written in. Is it any wonder so many people skip the middleman and just put the print statements directly in their program? In hindsight I don't think it's any coincidence that
UPS, my favorite C debugger, lets me
dynamically insert |
These are my WanderingThoughts GettingAround This is part of CSpace, and is written by ChrisSiebenmann. * * * Atom feeds are available; see the bottom of most pages. Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web |