Top
Best
New

Posted by never_inline 7 days ago

Things you can do with a debugger but not with print debugging(mahesh-hegde.github.io)
254 points | 214 commentspage 4
bagels 4 days ago|
"you can’t use them when your application is running on remote environments"

This isn't always the case. Maybe it's really hard in a lot of cases, but it's always not impossible.

makeitdouble 4 days ago|
I read it as dealing with applications you only get shell access to and can't forward ports.
7bit 4 days ago||
And that's why I never learned Elixir, despite being an interesting languge with an awesome web Framework, Phoenix.

The fact that there ist No Debugger is super unfortunate

user3939382 4 days ago||
Don’t tell Primeagen. Although he’s right about debugging sprawling systems in Prod. I’d argue the stateful architecture of these apps is the root cause.
perryizgr8 3 days ago||
The really hard bugs are those that disappear if you make changes to the binary, like adding a print.
gigel82 4 days ago||
I am surprised all the time in this industry how many software engineers still debug with printf. It's entirely baffling how senior / staff folks in FAANG can get there without this essential skill.
b0ringdeveloper 4 days ago||
I think it would be interesting to view this from a different angle. Perhaps "Lots of people who know of debuggers still use printf debugging, maybe they're not all wrong and there are advantages that aren't so clear."
mjevans 4 days ago|||
Good print statements can become future logging entries for when software ships and debugging statements need to be turned on without source code access.
spacechild1 4 days ago|||
I think nobody is arguing against logging. However, printf-debugging typically means that you are inserting temporary printf statements to debug a specific issue. In that case, you can just use tracepoints instead (if your debugger supports them).
giveita 4 days ago|||
Yeah and by good print statement you mean use a structured logging lib?
kstrauser 4 days ago|||
“All these senior/staff FAANG folks are using a different tool than the one I regard as essential.”

There are a couple of ways to resolve this conundrum, and you seem to be locked on the less likely one.

What if… that weren’t an essential skill?

yepitwas 4 days ago|||
I'm so used to bouncing between environments my code's running in (and which project I'm working on) that I tend to just assume I don't have debugger access, or at least don't have it configured for that environment, even when I do. Like I'm just in the habit of not reaching for it because so often it's not actually there. It rarely matters much anyway (though when it does, yeah, it really does).
MangoToupe 4 days ago|||
I'm surprised that you can get that far without seeing value in print debugging.
happytoexplain 4 days ago||
Imagine I posted the bell curve meme with "print debugging" on both ends.
thr0w 4 days ago||
No way, sorry. The bug you're trying to squash isn't complicated enough if print statements are as valuable as a debugger. And I get what you're after - this is coming from someone who regularly uses `grep` to answer questions faster than my clients' dopey ETL/DB setups.
makeitdouble 4 days ago|||
Quite seriously, there will be whole categories of bugs you won't catch with a debugger (same way printf or CLI execution etc. have their limitations).

The debugger will never be completely transparent, it also eats resources in parallel to your application, and peeking into the session also introduces timing issues, short of the debugger itself having its own bugs.

I'm saying it would be dumb to dismiss all other tools for the love of debuggers, it's just one tool in the toolbox.

MangoToupe 4 days ago|||
Complicated enough for what?
sharts 4 days ago||
What’s a good debugger for bash?
complex_pi 4 days ago|
set -x
never_inline 4 days ago||
Didn't expect this to blow up, and now I realize it's bit of a flame bait topic, haha.
coldtea 4 days ago|
Cases where I absolutely need to do these things to solve a bug: 0%

Maybe 0.1%