Hacker News new | past | comments | ask | show | jobs | submit login
Print Debugging Should Go Away (ocallahan.org)
5 points by pcfwik on Nov 13, 2023 | hide | past | favorite | 3 comments



Well stated opinion; but not everybody thinks like the author does, nor should they.

People so often miss that the continued presence of diverse tools to achieve the same ends means that there's reason for it. In this kind of case, it's because the minds on the other ends of the tools are varying wildly and different types need a different "grip" on the problem of debugging.

emacs or vi or DWIM toys like VScode etc? what works for you is the one you should use. that's likely not the same thing that works for any other person.


this is so "my way or the highway" attitude. It's like asking a pro-golfer to change their swing or tennis player to use a different grip. I'm going to keep print debugging because it's right for me.


I disagree. He states quite clearly that the “it’s right for me” argument has a flaw. If there are 6 possibilities and you examined 5 before deciding that number 3 was “right for you”, then you cannot actually state that you know that #3 is better than #6.

Then, he points out that printf debugging requires that you recompile and rerun your code every time you add or remove a printf. Pernosco, on the other hand, let's you record your program once and then add printfs to it later. Each time you add a printf, you get a complete list of all the things it would have printed had it been part of your program when you ran it. You don't have to recompile or rerun it.

If your program originally ran for an hour and your new printf would have printed a million lines, Pernosco doesn't make you wait an hour. It simply computes what would have been printed, and does so in a few seconds. It doesn’t even start at the beginning of the program either, or generate all million lines at once. It starts with the lines that will actually be visible in the log window, which could be at any point in the execution. More log lines are computed on the fly as you scroll around.

I think that Pernosco gives you superpowers.

In fact, while it might be rude to tell a golf pro to change their grip, I would argue that you’re not actually a pro unless you’re using Pernosco. (Or a debugger with identical features, if any exist.)




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

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

Search: