Hacker News new | ask | show | jobs
by atq2119 514 days ago
> What they don't do, is waste time walking around looking for spare money that has been dropped. Because that would almost certainly be a waste of time.

Why is it usually a waste of time? Because people rarely lose multiple bills of money, and if they do, our vision system is well equipped to spot the other bills quickly.

The opposite is often true with software in my experience.

When there is a bug, it's often because the software is in a state of imbalance and confusion, and there are multiple bugs nearby.

And humans tend to be relatively bad at spotting bugs.

So, when you see a bug it is usually worth spending a moment to reflect on whether you've fixed the bug properly and whether there are other bugs in the vicinity. It is likely to be worth it just for the bug fixes.

But there's also the learning effect that comes with it as described by TFA.

1 comments

Again, if you see a bug, fix it. If you are already in a section of code, read through all of it. And heck, if you are not running late on anything, feel free to start trying to re-architect parts that you think are off.

If I'm just caught by a strawman at the start of the essay, apologies on that. I legit don't know anyone that casually encourages bugs as long as you have features. Tolerances are a thing, but so is negligence.

About 30 years ago, there was this wonderful book, called Writing Solid Code[0]. Reading it, was a watershed, in my personal development.

It has many techniques described, that have since become Canon, and a number that have not aged so well.

One that is probably impractical, these days, is Step Through Your Code. He recommends stepping through every line of your code in a symbolic debugger, making sure that the code flow is what you expect, and the app state is appropriate.

Every now and then, I can do it. Often, when I’m already there, for something else. It really does work.

[0] https://writingsolidcode.com/

It's not that I know people who casually encourage bugs, but I know plenty of people who don't habitually do the kind of thing you describe in your first paragraph.