News for hackers. Stuff that matters.
Re:Icecream: Never use print() to debug again in Python by magicalhippo on Tuesday March 30, 2021 @07:36AM (#26633396)
Depending on how complex your debugger is, it allows you to output values that might not be inspectable through the debugger. Especially computed values.

Debug printing also allows you to debug programs running in environments where you can't attach a debugger. For example, maybe halting the program causes the bug not to trigger. Or it's a remote system where you cannot attach a debugger for various reasons. Or the bug only happens in the optimized build, which in say C/C++ can make it quite tedious to walk through with a debugger.

Most of the time though I use print as "proactive debugging". Having detailed logs available is gold when customer calls with a blocking issue.

Re:Icecream: Never use print() to debug again in Python by stinos on Tuesday March 30, 2021 @10:36AM (#26635066)
Especially computed values

Showing function return values automatically was really an eye-opener when I first encountered it.

Re:Icecream: Never use print() to debug again in Python by pjmlp on Tuesday March 30, 2021 @08:01AM (#26633583)
Most OS offer that with process tracing like ETW and DTrace.