Debuggers Make You a Bad Detective
thinkingmuchbetter.com
thinkingmuchbetter.com
But gdb helped me understand why printf() was not working as intended, how those pesky register worked, remove memory leaks, and overall taught me a lot, fast. I had to rewrote malloc() using mmap at the start of my second year, i don't think any amount of printf() would've helped me as much as gdb and valgrind did. Also watchpoints basically do the same job as printf most of the time (but are more tedious to use).
I find pdb() usefull too (although it might be because i don't understand python as well as i should). I definitely use print() though, like said in the article, to narrow down where the break points should be placed. And i think than more than half the time i used pdb() it was on my test files, whether it was unit testing or feature testing (those are hard :/), so better test coverage would not help me much.
Also, debugging Common Lisp with (print) is usefull for beginners not used to the REPL, but once you understand how this whole slime/REPL thingy works, not using it to debug is bold.
I agree though. If someone knows the code intimately and still doesn't have a rough clue about why a bug exists, and the first thing they do is look at the programs entry point and step into all the way until something pops out, it certainly will take you forever. And in this context, OP is certainly right.
Coming to debugger in python (pdb), in your blog you criticize using debugger to step line by line. But this need not be the case, one can jump to debugger prompt and set a break point from the prompt itself where one feels something is wrong and continue to that break point and repeat this process. So one need not to jump through each line. In such a case it works equivalently to carefully put print statements, i.e judiciously put print statements = judiciously put breakpoints, what do you think?
A professional uses them to trap events and then explore the programs state. And to inject faults and watch how the program explodes, or not. In that debuggers are vastly better than printf debugging.
EDIT: one of the comments by the author makes it very clear: they don't consider lots of things you can do with e.g. gdb as "using a debugger": https://lemire.me/blog/2016/06/21/i-do-not-use-a-debugger/#c... </EDIT>
The submitted article here is similar, by opening with that ridiculous example and pretending that's what using a debugger means. Debuggers don't make you bad at finding problems. Not knowing when to use which tool makes you bad at it. (And knowing how to make new tools out of your existing ones is also quite helpful)