I gave a talk this week about a big mistake I made once in my career. In a nutshell, I developed an AB test for a website that accidentally stopped transactions from being able to be completed, resulting in revenue taking a quite literal nose-dive for over an hour. It was a pretty trivial HTML mistake too that did the trick.
I felt pretty shit about it for a while, and it wasn't really until I left the company some weeks or months later that I was able to see what really indirectly caused it, and thus be able to laugh about it. Nobody had a go at me about it at the company. My manager did take me to one side at a certain point to have a chat about what happened, and help me feel better about the situation, which was completely the right thing to do, and something I've learnt from.
The whole point of the talk was only to highlight that, to quote the title of this post, shit happens. All of us are human, bound to make mistakes despite the best of intentions. Programmers are particularly vulnerable to mistakes since they usually involve systems that are complicated as fuck to maintain or improve. Do you know about the computer bug that literally caused a rocket to explode during launch? It was caused by a missing overbar - something infinitely easy to miss with a disastrous and rather expensive result.
They can happen no matter what experience level you are too. Even the smartest computer programmer in the world would make mistakes on an almost daily basis. Typically, small trivial mistakes, but occasionally the big "oh fuck" mistake too. As long as the person in question learns from the mistake.
Also, it really helps to not highlight who the perpetrator of the mistake was. It's pointless, achieves nothing, and makes the person feel more shit than they possibly were. Any mistake can usually be attributed to be a result of a problem with the team, or practices being served.
So, to recap this slight ramble; mistakes happen. Learn from them. Find out what can be better, and highlight what can be done to prevent it from happening again.
Want to see the slides? Here you go.