3 ms·
If print statements outperform debuggers at debugging, it might point to a design flaw in debuggers. Why are print statements better? Could a debugger, designe
by vendiddy 3y ago
If print statements outperform debuggers at debugging, it might point to a design flaw in debuggers.
Why are print statements better? Could a debugger, designed considering this, beat print statements?
- slotrans 3y agoBecause a series of print/log statements can illustrate the evolution of state over time, where a debugger only shows you "now".
- vendiddy 3y agoPerhaps a well-designed debugger could do much better than print statements. Let me visualize the changes of variables over time and what code caused those changes. Or one click in the gutter to add "log points" vs having to type "print(...)" every time. Or even track everything and let me activate logs after the fact, as I learn where I need more granularity. The conclusion of "print is better than debuggers" doesn't sit well with me. The standard debugger design sucks--so we to resort to print, which sucks a bit less. If anyone has links to fresh takes on debuggers, please share!
- NoZebra120vClip 3y agoI've often used "strace" and friends for debugging, especially where there is a lack of source code and ability to build an appropriate binary. strace is all about logging the state over time. Of course, it's limited to system calls, and not C library stuff or algorithmic computations, but if your application is system-call dependent, such as networking or file I/O, strace can be a great tool.