3 ms·
I'm on the second camp of that divide as well. Most times, all you really need is the logging functionality (whether you get it from a logger or a debugger) to
by mekoka 6y ago
I'm on the second camp of that divide as well. Most times, all you really need is the logging functionality (whether you get it from a logger or a debugger) to observe the outcome of an action. It's not really necessary to witness unfolding before your eyes the step-by-step playbook of how a variable came to acquire the wrong value. It's enough to see that it got the wrong value and from there you can infer what the problem is and the corrections to apply. That's most times.
However, some intricate situations are better suited for the debugger (flags set in inner loops, circuitous algorithms, values unknowingly inherited, values mistakenly overridden, etc). In those it usually is harder to reason about the flow of the logic. In my experience that's where a debugger shines, as it shows you what the code is doing. But even then and with enough experience and instinct, you can get by with just logging a value and reading the code.
Some renown programmers on how they don't use debuggers:
L. Torvalds: https://lwn.net/2000/0914/a/lt-debugger.php3 https://lwn.net/2000/0914/a/lt-debugger.php3
J.G. Cunningham: https://blog.jgc.org/2007/01/tao-of-debugging.html https://blog.jgc.org/2007/01/tao-of-debugging.html
Robert C. Martin: https://www.artima.com/weblogs/viewpost.jsp?thread=23476 https://www.artima.com/weblogs/viewpost.jsp?thread=23476
- qtgx199 6y agoOn my own code I don't need debuggers, that is the scenario that Linus is talking about -- is Robert C. Martin a renowned programmer? :-) For other people's Python code, especially if they mistakenly think that Python is Haskell, I do need a debugger. I've seen "scientific" Python code that is iterators all the way down and can only be understood by running the program. Of course no actual science is being done with such programs, but that doesn't seem to matter.