5 ms·
I agree with the title that you shouldn't look down on print debugging. You should look down on people who are slow at fixing bugs and who refuse to try tooling
by cdrini 2y ago
I agree with the title that you shouldn't look down on print debugging. You should look down on people who are slow at fixing bugs and who refuse to try tooling to be able to keep pace -- and using print statements can sometimes be a marker of this. But print debugging is just a tool and has its place, and the use of print debugging is not itself an indicator of poor developer performance. If you can find/fix bugs as quickly as I can with a debugger using print statements, then I don't care what you use. If you can do it faster, then I'm going to try to steal your techniques so I can be faster too. If you do it slower, then I hope you would steal my techniques.
Don't care about the tool care about the performance.
Anecdotally, debuggers are faster than print statements in most cases for me. I've been able to find bugs significantly faster using a debugger than with using print statements. I still do use print statements on occasion when I'm developing something where a debugger is very complicated to set up, or in cases where I'm dealing with things happening in parallel/async, where a debugger is less suited. I'm not going to shame you for using print statements, but I do hope that you've tried both and are familiar/comfortable with both approaches and can recognise their strengths/weaknesses -- something I'm not convinced of by this author, which only outlines the strengths of one approach.
Also not a fan of the manufactured outrage of saying people are being "shamed" for using print statements. Coupled with listing a bunch of hyperbolic articles -- many of which don't even seem to be about debugging but about logging libraries.
(Also as a side note: don't forget if you are using print statements for debugging to check if your language buffers the print output!! You'll likely want to have it be unbuffered if you're using print for debugging)
- llm_trw 2y agoI find the people quick at fixing bugs are even quicker at introducing new bugs.
- dgfitz 2y agoI have the complete opposite experience. I learned how to use a debugger from the only 10x programmer I’ve ever had the pleasure of working with. Person was a wizard at finding bugs. And they didn’t write many. My goal in code reviews was to find them from this person. I found 2 in 5 years.
- llm_trw 2y agoYou have one counter example. How many 0.1 programmers are there using a debugger to blindly change values in the program in the hope it fixes the bug? I've seen dozens.
- nicce 2y agoSometimes there just isn’t good enough debuggers available. Particularly in Rust, the type system is very complex and debuggers often fail to show enough information and dbg! becomes superior. I mostly use debuggers when I try to understand someone else’s code.