7 ms·
Needs "Essential Debugging with print statements"
by jwcrux 11y ago
Needs "Essential Debugging with print statements"
- ams6110 11y agoThough that's often a good technique.
- BinaryIdiot 11y agoGood...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().
- mrkgnao 11y agohttps://tenderlovemaking.com/2016/02/05/i-am-a-puts-debuggerer.html https://tenderlovemaking.com/2016/02/05/i-am-a-puts-debugger...
- coldtea 11y agoThere'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
- JoshTriplett 11y ago> 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.
- jschwartzi 11y agoIt's such a simple tool that it feels wrong the first time you do it.
- tdsamardzhiev 11y agoYet it's also the only thing that actually works in a tough debugging situation.
- interfixus 11y agoThank you so much. I shall give my guilt complex its first day off for twenty years.
- adamson 11y agoIf you want to justify it even more, you can think of it as testing invariants at various points in your program flow!
- neves 11y agoOne of the best things of the interview book "Programmers at Work", was that all the greatest programmers used printf to debug.
- datenwolf 11y agoThe 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.
- mitchty 11y agoDoes pr_debug count as a print statement? Cause I use that every day.
- royce 11y agoInside every set of debugging print statements is a debugging verbosity level trying to get out.