this post was submitted on 03 Oct 2025
169 points (98.3% liked)

Programmer Humor

38576 readers
437 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] bleistift2@sopuli.xyz 22 points 19 hours ago (7 children)

Sometimes there’s literally no other way (that I know of). When you’re debugging concurrency issues, stopping all time with a debugger just isn’t an option.

[–] Ephera@lemmy.ml 3 points 18 hours ago (4 children)

I guess, there's technically nothing which dictates that a debugger has to work by stepping through a program. It could also present you some diagram of variable values changing over time. But yeah, gonna be hard to find a more useful representation than those values being interleaved with your logs, at least for most applications. I have heard of more advanced debuggers being used in gamedev, which makes sense, since logs aren't nearly as useful there.

But yeah, given that most people think of the stepping debuggers, them being the default advice does feel emblematic of our industry still shying away from concurrency.

[–] mcv@lemmy.zip 2 points 9 hours ago (2 children)

I can also see the variables change by logging them.

Debuggers are great if you want to see in detail what's going on in a specific loop or something, but across a big application with a framework that handles lots of things in unreadable code, multiple components modifying your state, async code, etc.; debuggers are a terrible way to track what's going on.

And often when I've found where it goes wrong, I want to check what was happening in a previous bit of code, a previous iteration or call. Debuggers don't go back; you have to restart and run through the whole thing, again finding exactly where it went wrong, but now just a bit before that, which is often impossible.

With logging, you just log everything, print a big warning where the thing has gone wrong, and scroll back a bit.

Debuggers are a fantastic bit of technology, but in practice, simple logging has helped me far more often. That said, there are issues where debuggers do beat logging, but they're a small minority in my experience. Still useful to know both tools.

[–] barubary@infosec.exchange 2 points 8 hours ago (1 children)
[–] mcv@lemmy.zip 2 points 6 hours ago

This does sound very interesting. I should have said the debuggers I'm familiar with don't do it. Or if they do, I have no idea how.

Certainly setting breakpoints on certain conditions instead of just a line, would help a lot. Being able to step backwards through the execution even more so.

load more comments (1 replies)
load more comments (3 replies)