Hacker News new | past | comments | ask | show | jobs | submit login

>Sprinkling printf statements is an efficient debugging technique.

I’m a senior engineer for one of the big tech companies. For some issues, printing (or writing to your logger) is certainly what you’ll try again and again and it can absolutely get you a far way or down to the root cause. It’s not the best strategy (Depending on what you’re dealing with) but it can often work.

Where it’s probably less fruitful most of the time is if you’re debugging some kind of distributed system that has just that one edge case which occurs < 1% of the time in production against real traffic, and it’s entirely your own damn fault for trying to reinvent distributed locking or something akin to your own algorithm that “handles” eventual strong consistency.




I find it depends on the language, too. Some make debugging a little harder, but are so easy to mess with (REPL or similar), that printing is sufficient and easier 95%+ of the time.

Some languages invite sufficient complexity that you need to actually step through most code written in them...and they also offer the facilities to do so fairly easily.

So I'd say this really depends on the language.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: