News for hackers. Stuff that matters.
Re:Three of the Hundred Falsehoods CS Students Believe by beatgammit on Sunday November 10, 2019 @07:30PM (#21501211)
Also:

> Sprinkling printf is an efficient way to debug.

I mostly work on threaded code, and print statements are my go to for tracking down weird timing issues. Things behave much more differently when attaching a debugger, and adding good logs makes a ton of sense long term anyway, so yeah, print statements are absolutely a great approach to debugging.

A lot of them are true, but several aren't. I guess that's the thing about lists...

Re:Three of the Hundred Falsehoods CS Students Believe by astatine on Sunday November 10, 2019 @11:25PM (#21502142)
> > Sprinkling printf is an efficient way to debug.

> I mostly work on threaded code, and print statements are my go to for tracking down weird timing issues.

I have found printf to subtly alter timing in threaded programs. Either masking issues or introducing them.

Anecdotally, I remember some programs being reported as working only with a printf present and bombing when removed.

Re:Three of the Hundred Falsehoods CS Students Believe by lostcolony on Sunday November 10, 2019 @11:46PM (#21502218)
Yeah, but the likelihood of a printf throwing the timing off is generally lower than a breakpoint.
Re:Three of the Hundred Falsehoods CS Students Believe by couchand on Sunday November 10, 2019 @08:55PM (#21501532)
Sprinkling printf is very different from "good logs". Moreover, logging is not primarily for interactive debugging, but rather for monitoring. They're complimentary practices.
Re:Three of the Hundred Falsehoods CS Students Believe by chiffre01 on Sunday November 10, 2019 @09:27PM (#21501660)
I've found sprinkling print statements to be an easy and quick alternative to setting up logging.