News for hackers. Stuff that matters.
Re:Icecream: Never use print() to debug again in Python by andix on Tuesday March 30, 2021 @08:36AM (#26633856)
Because you shouldn’t have to change code, just to debug it.

It’s okay though to add verbose logging as a feature.

But just adding some print statements to debug code and remove them afterwards, is dangerous (you release sth different than you debugged).

Re:Icecream: Never use print() to debug again in Python by ben-schaaf on Tuesday March 30, 2021 @09:12AM (#26634175)
As opposed to software breakpoints which change your compiled binary at runtime in order to debug it. Even if you're using hardware breakpoints you're still changing what the CPU is doing and can easily make multi-threading bugs disappear.
Re:Icecream: Never use print() to debug again in Python by 0xFFFE on Tuesday March 30, 2021 @08:42AM (#26633900)
I do it in a different branch & discard it afterwards. Having said that, I never meant print() should be used in place of a proper debugger. All I am saying is they both can complement each other and each one has its place & value. As for me, I find it quicker to add a few print statements and get a rough idea before firing up a debugger(if required). May be others are more proficient in using debuggers. But print() works for me.
Re:Icecream: Never use print() to debug again in Python by Consultant32452 on Tuesday March 30, 2021 @08:39AM (#26633874)
############################# What? #########################