News for hackers. Stuff that matters.
Re:Parody O'Reilly book covers by jwcrux on Friday April 08, 2016 @11:04PM (#11459681)
Needs "Essential Debugging with print statements"
Re:Parody O'Reilly book covers by coldtea on Saturday April 09, 2016 @12:42AM (#11459955)
There's nothing wrong about "debugging with print statements".

If anything, if you're any good at it, it shows better knowledge of your program's behavior than blindly looking around in the stack on a debugger.

In fact some of the biggest name programmers use just that -- including the very people who created .

At best it's "hardcore" -- but not "bad" or anything like what's in the list. Here's some appeal to coding authority for ya:

"The most effective debugging tool is still careful thought, coupled with judiciously placed print statements." Brian Kernigham

"I don't like debuggers. Never have, probably never will." — Linus Torvalds

Re:Parody O'Reilly book covers by JoshTriplett on Saturday April 09, 2016 @12:52AM (#11459981)
> There's nothing wrong about "debugging with print statements".

Nor is there anything wrong with searching for the text of an error message, but both are funny to see as a fake book cover.

Re:Parody O'Reilly book covers by jschwartzi on Saturday April 09, 2016 @02:09AM (#11460163)
It's such a simple tool that it feels wrong the first time you do it.
Re:Parody O'Reilly book covers by tdsamardzhiev on Saturday April 09, 2016 @02:20AM (#11460179)
Yet it's also the only thing that actually works in a tough debugging situation.
Re:Parody O'Reilly book covers by interfixus on Saturday April 09, 2016 @02:58AM (#11460281)
Thank you so much. I shall give my guilt complex its first day off for twenty years.
Re:Parody O'Reilly book covers by adamson on Saturday April 09, 2016 @03:18PM (#11462812)
If you want to justify it even more, you can think of it as testing invariants at various points in your program flow!
Re:Parody O'Reilly book covers by neves on Saturday April 09, 2016 @01:33AM (#11460092)
One of the best things of the interview book "Programmers at Work", was that all the greatest programmers used printf to debug.
Re:Parody O'Reilly book covers by datenwolf on Saturday April 09, 2016 @08:24AM (#11460967)
The very first thing I do when starting a new project is putting the logging infrastructure in place. In production you don't want to spam stderr with each and every event. But if some operation fails the best way to understand why, is having a precise log of what chain of operations lead to this error.
Re:Parody O'Reilly book covers by mrkgnao on Friday April 08, 2016 @11:52PM (#11459812)
Re:Parody O'Reilly book covers by ams6110 on Friday April 08, 2016 @11:19PM (#11459730)
Though that's often a good technique.
Re:Parody O'Reilly book covers by BinaryIdiot on Friday April 08, 2016 @11:44PM (#11459786)
Good...or the only / expedient option?

I remember the good old days over 10 years ago debugging PHP in such a way. When I moved into .Net I thought "wow I never need a print statement again with the awesome debug tools". But leaving the comfortable embrace of Microsoft and even today I'm using print / console.log().

Re:Parody O'Reilly book covers by royce on Sunday April 10, 2016 @01:01AM (#11464979)
Inside every set of debugging print statements is a debugging verbosity level trying to get out.
Re:Parody O'Reilly book covers by mitchty on Saturday April 09, 2016 @03:59AM (#11460428)
Does pr_debug count as a print statement? Cause I use that every day.