Live data from Hacker News

Ask HN: How to make fewer mistakes?

news.ycombinator.com

61–70 of 75 posts

Re: Ask HN: How to make fewer mistakes?

#61
IMO improve in the small things. In many cases, developers take on large projects but have little opportunity to see the small things.

Pick a very small but important part to improve in. The most effective training I did for myself was to practice pressing shift, semicolons, and brackets accurately.

Wherever you have the most trouble with, narrow it down as small as possible. Practice writing tests. Practice your algorithms, or working with a very specific part of the stack. Things like Rx can be quite a lot to grasp.

It's not enough to know something once. You should be achieving fluency in all the little parts.

Re: Ask HN: How to make fewer mistakes?

#62
post #20

When I was getting my pilot's license, multiple times I started up without unchaining the tail. I joked about it with another instructor, and he basically said that it had literally never happened to him and that I should be doing a final walk around. I'd done even more embarrassing things, sitting at the runway ready to go and the tower tells me my baggage door is open. Since making that final walk around a habit, n…

I will implement the "final walk around" in my dev/thought process, this is a really valuable advice, thank you.

PS. `git add -p` is amazing, thank you for this too.

Re: Ask HN: How to make fewer mistakes?

#63
post #33
post #20

When I was getting my pilot's license, multiple times I started up without unchaining the tail. I joked about it with another instructor, and he basically said that it had literally never happened to him and that I should be doing a final walk around. I'd done even more embarrassing things, sitting at the runway ready to go and the tower tells me my baggage door is open. Since making that final walk around a habit, n…

I was hoping someone would mention being a pilot in this discussion. If you learn to fly, you will learn to follow checklists. Many, many checklists. A good instructor will tell you that while you do need to follow the checklists, it never hurts to do one last check. One final walk-around before getting in the cockpit, one last check of radios/transponder, one final scan across your engine instruments before takeoff,…

I came here to say basically this. Checklists are unreasonably effective. And if you can automate them with some form of metaprogramming, even better!

Re: Ask HN: How to make fewer mistakes?

#64
post #9

I believe my #1 defense against mistakes is the faint unease in the back of my mind that arises when I don't completely understand the problem. If I become aware of this nagging doubt, and follow it, it leads to the part I don't completely understand, where mistakes are likely. You can spend quite a long time seemingly immersed in a problem space without really understanding all of it. I think I may unconsciously fli…

I have that "faint unease" too, i need to give it more importance.

In the beginning i learn to ignore it because the mentality of "moving fast and break things", and really worked because my tasks were fairly simple and it would have fewer critical points, but thinking now that is harmful when doing more complex things, i should slow down and trust in my 'feeling' more.

Re: Ask HN: How to make fewer mistakes?

#65

In addition to what everyone else has said about just having more experience, my suggestion is slow down and think... and to use assert a lot! I've noticed that some developers rely way too much on tools to do their job and they just don't spend a lot of time thinking . Think about the big picture as well as the details. Think about how your code interacts with its surroundings. Think about what you know to be true a…

Second on that use of assert. "Be assertive!" I always say.

Most language offer a way to run in DEBUG mode, or something like it, use that, along with assert (which only runs in DEBUG mode) to make sure all your assumptions are correct. You're positive a value can never be NULL? assert that! You're absolutely positive an integer addition will not overflow? assert that! You're absolutely sure that your super-fast table returns the same results as the complete algorithm? Run them both in debug mode and assert that!

Re: Ask HN: How to make fewer mistakes?

#66
post #63
post #33

Earlier quoted context omitted.

I was hoping someone would mention being a pilot in this discussion. If you learn to fly, you will learn to follow checklists. Many, many checklists. A good instructor will tell you that while you do need to follow the checklists, it never hurts to do one last check. One final walk-around before getting in the cockpit, one last check of radios/transponder, one final scan across your engine instruments before takeoff,…

I came here to say basically this. Checklists are unreasonably effective. And if you can automate them with some form of metaprogramming, even better!

Example?

Re: Ask HN: How to make fewer mistakes?

#68
Outside of code, I don't think there is anything with making mistakes. It's a path towards progress, learning, and growth.

It is important that you figure out why the mistake was made, and how to not recreate it in the future.

I tell my employees that creating 1000 individual mistakes is fine, so long as none of them are repeats.

Re: Ask HN: How to make fewer mistakes?

#70
post #66
post #63

Earlier quoted context omitted.

I came here to say basically this. Checklists are unreasonably effective. And if you can automate them with some form of metaprogramming, even better!

Example?

Here's a good one: A few years back, I had a quick stint as a wordpress PHP magician. The php community has a tool called php code sniffer. The wordpress community has a collection of "sniffs" (rules) to enforce coding conventions[0]. One folder of rules is called "Security"[1]. Set up a git precommit hook to run phpcs with whatever set of rules you like and it will give you a list of things you need to fix before your code can be committed. Automatically.

In the JS/webpack/react world, there's eslint. You can write custom rules to automatically check for and enforce whatever you have on your checklist.

[0]: https://github.com/WordPress-Coding-Standards/WordPress-Codi...

[1]: https://github.com/WordPress-Coding-Standards/WordPress-Codi...

Post reply on HN