Eduardo Bouças shared the worst mistake he’s made as a developer, along with advice on what to do when you do make a mistake.
When I hosted Eduardo Bouças on Code Sandwich Hour, I asked him one of my favorite questions:
What is the worst mistake that you've made as a developer?
Eduardo said:
I make mistakes all the time. I've caused incidents that affected customers in production. That happened multiple times, and it will happen again.
You will make plenty of mistakes. You will mess things up. You will introduce bugs.
Learn from that and move on.
I love this advice because it's direct, true, and helpful.
The one thing that you can guarantee that you're going to do is make mistakes. Junior developers do it. Senior developers do it. You can (and should) try really hard to avoid it, but it will still happen.
The best way to deal with mistakes is to roll over them — to learn from them, so that you avoid making that same mistake in that same scenario.
Keep writing code. Don't be (too) afraid to introduce a mistake, because every time you do, you're going to become a better programmer by learning from it.