News for hackers. Stuff that matters.
Re:The Sad State of Debug Performance in C++ by bluGill on Monday September 26, 2022 @10:13AM (#32983348)
I'm with Kernigham and Pike: the debugger is for getting a stack trace out of core dumps. Printf is for debugging.
Re:The Sad State of Debug Performance in C++ by properparity on Monday September 26, 2022 @03:22PM (#32987119)
Why limit yourself to crusty text when you can have live visualizations of data structures in various formats, graph dx/dy over time of some variable, stop and inspect data on some condition without having to modify code, quickly start execution on a certain line, quickly drill down into struct members, etc.

I mean it does everything a printf() can do - except just better.

Re:The Sad State of Debug Performance in C++ by nice_byte on Monday September 26, 2022 @03:36PM (#32987295)
> Why limit yourself to crusty text when you can have live visualizations of data structures in various formats,

Because that's too fruity, real men (tm) don't use debuggers /s

Programmers are so funny, they'll present themselves as rational and logical, but then follow the advice of some old geezer who thinks syntax highlighting is for pussies rather than admitting that their tools suck and need to be better.

I have a particular chip on my shoulder about this whole printf debugging thing: https://twitter.com/nice_byte/status/1465200027672866816

Re:The Sad State of Debug Performance in C++ by Night_Thastus on Monday September 26, 2022 @03:30PM (#32987213)
For a couple months I had no functioning debugger and was left with only Printf's. I do not ever desire to go back to that. It is far too painful. I think my time to find issues likely was 4x+ longer than before.

Some programs simply have too much state, too complex of structures (for performance or memory reasons), or very long runtimes to reasonably debug purely with prints.

Re:The Sad State of Debug Performance in C++ by bluGill on Tuesday September 27, 2022 @08:51AM (#32994656)
The one thing printf does better is force me to stop and think about why.

I find that when I use a debugger I fall into the trap of mindless looking at variables, stopping to inspect data (sometimes changing a variable), drilling down into struct members... (That is your exact list except I've never used a debugger that can graph dx/dy though I'm sure that applies too) All the while forgetting that the real goal is to figure out why the program is in the bad state i the first place.

If you can avoid that trap all those tools of debuggers are useful. I sometimes do use a debugger for each of the above things, but I make it a point to limit the time I spend in the debugger.

Re:The Sad State of Debug Performance in C++ by ninkendo on Monday September 26, 2022 @03:37PM (#32987319)
I’ve personally never been in a bare-metal environment where the debugger is truly reliable. JVM works great, so does V8 and probably most other VM-style environments, but C++? Swift? Rust? I’ve never seen a truly reliable debugging environment that doesn’t just arbitrarily stop working when I try to inspect a symbol, some subset of the time.

If debuggers were reliable, I’d take them over printf-debugging any day. But to this day I’ve never seen one that is.

Re:The Sad State of Debug Performance in C++ by dw-im-here on Tuesday September 27, 2022 @03:14PM (#32999794)
I didn't expect something as silly as this coming out of Kernighams mouth
Re:The Sad State of Debug Performance in C++ by bluGill on Wednesday September 28, 2022 @09:39AM (#33007783)
You should read "the practice of programming", he (well mostly Rob Pike if I understand the relationship) has some well reasoned criticism of the ways people use debuggers. In fact it is not silly - debuggers often make people feel more productive than they really are, so if you use a debugger (which I do once in a while) be careful to be objective about them.
Re:The Sad State of Debug Performance in C++ by jjtheblunt on Monday September 26, 2022 @01:12PM (#32985597)
oh where is that quote? that's great!
Re:The Sad State of Debug Performance in C++ by bluGill on Monday September 26, 2022 @08:05PM (#32990242)
In the 'practice of programming'. https://www.cs.princeton.edu/~bwk/tpop.webpage/ I last read it some years ago so I can't tell you exactly what they said. I do know that when pointed out I realized I suffer from the same sins they hate about debuggers: I would step through code mindlessly, changing variables and the like, but never stopping to think. While printf is more painful it forces me to think why is the code in that state, which is key to fixing bugs.
Re:The Sad State of Debug Performance in C++ by jjtheblunt on Tuesday September 27, 2022 @03:34PM (#33000034)
i totally agree