Hacker News new | ask | show | jobs
by tanilama 2600 days ago
I think print statement makes it quicker and obvious to expose the internal state I want to observe at the precise point I want, thus fulfilling the hypothesis cycle faster. Debugger, on the other hand, seems effort taking to set up and expose too much additional details, it becomes overwhelming very quickly.
2 comments

Debuggers are print statements with a slightly different “effort profile”. Adding the equivalent print statement is a little bit more annoying, but you can do this at any point during runtime and also drop down into the full debugger when you need it.
When something goes wrong after X iterations, print statements can show the evolution better. That is one thing that debuggers don't do I think (track variables over time). Or do they and am I not finding this feature in IntelliJ? :O
GDB and LLDB allow you to put a print statement anywhere; they’re a strict superset of what you can do in code.
If you believe that, then you're probably using a poor debugger or just haven't learned how to use a really powerful debugger yet.