Earlier quoted context omitted.
I 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.
You 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.
Don’t look down on print debugging
161–164 of 164 posts
Re: Don’t look down on print debugging
#162Earlier quoted context omitted.
You 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.
You also provided one example, yours haha. I think we have concluded this anecdotal conversation.
Re: Don’t look down on print debugging
#163While print-type debugging has a place, the reason there are a lot of articles dissuading the practice is the observed reality that people who lean on print debugging often have incomplete knowledge of the immense power of modern debugging tools. This isn't just an assumption I'm making: years of being in developer leadership roles, and then watching a couple of my own sons learning the practice, has shown me in hund…
If you add a bunch of print statements every few lines, it's easier to run the code and see you got to the checkpoint line 1580 and 1587 but not 1601, than to have to manually click through a dozen breakpoints and note the last one you passed before the problem occurs.
If you have a "hard crash" where you can give a stack trace, that's less of a need, but often it's something like "this value was 125 when it entered module Foo and came back as 267". Monitoring the expression can sometimes help, but it might also be a red herring (we trap that it got set at the end of function Bar, but then we have to dig into function Bar to find the trace). Printfs can include whatever combination of values are worth reporting at any time.
Yes, any debugger can do all of that, but when trying to spin it up ad-hoc, printfs can be less hassle than trying to pull up the debugging tools and wire it up inside the IDE.
Re: Don’t look down on print debugging
#164Earlier quoted context omitted.
Agreed. I don't care how a team member debugs something as long as they can solve the issue.
Let's flip that around and replace "debugging" with "coding" for a moment. Imagine you have a new junior developer on the team, and their deliverables seem okay. Then one evening you discover they've been staying late manually reformatting and reindenting all of their code using notepad before each commit. They explain this is because it's what they know will work reliably, and those other tools gave odd errors on th…
But formatting is trivial whereas debugging is not.