News for hackers. Stuff that matters.
Re:As a developer, my most important tools are a pen and a n... by xnorswap on Wednesday May 28, 2025 @03:41AM (#44113590)
The conclusion I draw from this is that some debuggers are so bad it's not delivering value over "print debugging".

But perhaps it's a lack of knowing what a debugger can deliver.

A debugger gives you the ability to immediately dive in and instantly inspect the complete stack trace, all the values on the stack, all the values of local variables, etc. Without restarting the program or calling out specifically what you're going to want to inspect ahead of time.

A debugger will "pause the world" and let you see all the parallel stacks.

A debugger will let you set conditional breakpoints. If you need to debug the conditions for when a variable gets set to a particular value, a conditional breakpoint on the variable set to break when it's set to that particular value makes that a doddle.

A debugger will let you enumerate collections and re-write values on the fly.

A debugger will let you break on exceptions, even ones normally caught and handled.

A debugger can launch and attach itself.

All of that is a massive force-multiplier and time-saver, which print debugging doesn't deliver.

Re:As a developer, my most important tools are a pen and a n... by wiz21c on Wednesday May 28, 2025 @05:32AM (#44114223)
A debugger doesn't show you the evolution of your program over time. A few well placed prints give you that.

I use my debugger often, but sometimes you need to track the value of something over time (say, over 1000 iterations) and a debugger can't show you that.

So prints are still relevant. Debugger are more for "needle-in-haystack" stuff I think.

A debugger that could record the execution over time (and query that execution), that would be great. I know there are some, but are there for python for example ?

Re:As a developer, my most important tools are a pen and a n... by lcnPylGDnU4H9OF on Wednesday May 28, 2025 @08:23AM (#44115255)
> I know there are some

Do you mind providing examples? I’m not sure what I would search to find that and I’m interested in the idea.

Re:As a developer, my most important tools are a pen and a n... by danadam on Wednesday May 28, 2025 @11:26AM (#44117049)
I've never used it but sounds like https://rr-project.org/
Re:As a developer, my most important tools are a pen and a n... by Tainnor on Wednesday May 28, 2025 @07:07AM (#44114712)
A debugger will also allow you to step through library and framework code where you can't usually go and place print statements.
Re:As a developer, my most important tools are a pen and a n... by wglb on Thursday May 29, 2025 @10:05PM (#44132106)
I've spent some quality time with debuggers but have come to the conclusion that it is a seductive way to spend time that doesn't necessarily get me there any faster than with printf or equivalent.

Admittedly, I mostly develop with sbcl and slime, so the judiciously place 'break' statement brings you to a stack trace.

Also with sbcl/slime, you can do ESC-. on a function and go to the actual source, even deep within the core of sbcl itself.

Nonetheless, I mostly depend on logging statements and print statements. When I need to go to python, print statements give most of what I need.