If you can get past the F-bombs in his article, Chris Haseman has excellent advice for young programmers (or old, for that matter), in his blog post, "How to F*ck Up Like a Pro"...
If it hasn?t happened to you, it will.? That moment when you?re looking at the production server and seeing something that emphatically should not be there.? From the colossal to the minor, if you?re doing anything important, you will eventually f*ck up big.? Really big. Holy-shit-I?m-going-to-get-fired big.? What separates the pros from the amateurs, however, isn?t whether you make end-of-the-universe mistakes but in how you handle the aftermath.
I can attest that how you handle screw-ups dramatically affects your career.? Actually, his advice isn't just good for programming, it is good for sports. For relationships.? For lots of things, if you don't mind abstracting a bit.? When you screw up, his 7 step plan isn't too bad.? I'll paraphrase below.
- Take a deep breath.
- Don't raise the alarm until you spend at least a few (seconds|minutes) trying to assess how bad it really is.? Why? So that you can accurately convey the seriousness to people who can help (usually, above you in the food chain, but possibly your peers or even people working for you).
- If you have a little breathing room, think about a solution or fix.
- Inform the right people, talk to them about the severity.
- Talk about the fix, and how to avoid this happening again
- Vent (he used the word panic).? Blow off some steam.
- Fix it. Write up the postmortem for those who follow.
Most importantly, don't lose perspective.? Your dog still loves you, so do your friends and family.? Well, worst case your dog will still love you. If you can't make it work at this job, learn from it, introspect a little, and make it work at the next job.? But if you can survive these failures with grace, you may find that you not only improve your own lot in life, but that you can have a big positive impact on the fortunes of others as well.