4 ms·
My comment about the NaN bug: https://news.ycombinator.com/item?id=14156595 https://news.ycombinator.com/item?id=14156595
by brlewis 10y ago
My comment about the NaN bug: https://news.ycombinator.com/item?id=14156595 https://news.ycombinator.com/item?id=14156595
- mattmanser 10y agoI disagree with that assessment. Users reported the order was wrong, he simply had to look at those users and their live data to replicate it. Even in those scenarios, I rarely have to look at live data, reading the code is often enough to identify it or playing around a little bit. The patience to replicate a bug before trying to fix it. This is the essence that sets apart a good debugger from a bad one. A bad one resorts to littering the code with print/log statements because either they can't replicate the problem or they simply can't run the code in their head. I'm being unfair, it's not even that, they simply need more experience. When I was younger I remember complaining that exception stacks were utter gobbledigook, utterly useless. Now, I read one and often know exactly what the bug is. I was completely and utterly wrong, impatient and unwilling to admit my ignorance. At the time I thought I was wise and knowing. They're very useful, I simply didn't understand them. My "simply" from above belies the years of experience I have.
- brlewis 10y agoI have had times when I used logging and then realized I should use a debugger instead. I have had times when I used a debugger and then realized I was never going to find the problem that way; I needed a larger amount of information that only logging could provide. I've only been programming about 30 years so I probably haven't hit my peak yet, but my guess is that even with more experience I'll still want to use both tools. Debug logging doesn't have to be litter either. Instead of commenting out use log levels like with https://www.npmjs.com/package/debug-logger https://www.npmjs.com/package/debug-logger