Hacker News Clone new | comments | show | ask | jobs | submit | github repologin
Don't Look Down on Print Debugging (blog.startifact.com)
1 points by todsacerdoti 3 hours ago | hide | past | web | 3 comments | favorite





If you feel shame because of random opinions and articles on the internet, I’d address that before worrying about “print” vs. a real debugger.

I pretty much only use print debugging. I know how to use a real debugger but adding print/console.log etc. keeps me from breaking context and flow.


To me there are three requirements for me to be comfortable with a team culture of print-debugging.

1. If a breakpoint debugger exists for the stack, it should still be convenient and configured, and the programmer should have some experience using it. It's a skill/capability that needs to be in reserve.

2. The project has automatic protections against leftover statements being inadvertently merged into a major branch.

3. The dev environment allows loading in new code modules without restarting the whole application. Without that, someone can easily get stuck in rather long test iterations, especially if #1 is not satisfied and "it's too much work" to use another approach.


The shortcoming is print cannot always inspect pointers/objects. Once the debugger hits the breakpoint the entire context can be inspected.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: