Hacker News new | ask | show | jobs
by varispeed 35 days ago
Why people are still using debuggers?

I never felt the need for them when doing TDD.

2 comments

It's not that people are _still_ using debuggers; it's that people have actually discovered debuggers and workflows that are more productive than adding print statements, recompiling, and rerunning the program.

Casey has been talking about this some time ago: https://www.youtube.com/watch?v=UzD_Ze6zFKA

Also, John Carmack's perspective: https://www.youtube.com/shorts/PRE51epznT8

If you need to step with debugger, it means you are probably not understanding the code and cannot step through in your mind. Good test suite eliminates the need to debugger too.
Yeah, in my field this approach is pretty much infeasible.

Typically, I am given an ancient code base that is full of bad decisions, hard to read code and no tests in sight. Sometimes there are assertions, if I am lucky. It's impractical to create a reliably test suite, or rewrite everything from scratch.

Here, I heavily rely on a debugger just to make sense of the code. Sure, I'd wish that all of this code would just be sparkling clean, easy to read, free of UB, etc. But that's not the reality I work in, and good debugger is my number one tool getting the job done.

And don't even get me started on dealing with closed source implementations where all you could read is disassembly.

Because sometimes you have bugs and you haven't narrowed down the cause enough to write a proper test for it?