If you’ve read through this blog you may have noticed two seemingly conflicting ideas that I try to adhere to in my software development. The first is “Do it right the first time” and the second is “Be open to and learn from your mistakes”. Now you may be asking yourself, how I can I do it right the first time and be open to making mistakes? Doesn’t one necessarily exclude the other? I mean, if you want to do it right the first time, shouldn’t you make sure you don’t make any mistakes and if you are open to making mistakes then isn’t there a lower probability that you will do it right the first time. Okay, you got me there. These two ideas do seem to be conflicting. Let me try to explain.
First, when I say “Do it right the first time”, what I really mean is “Don’t knowingly do it wrong the first time”. In order to knowingly do it wrong the first time you have to be either lazy or malicious. If you know what you _should_ do, then there is only two reasons not to do it that way. One, you are lazy. That is, although you know that the correct solution will be harder and take longer to do, you choose not to do it because there is a quick and easy solution that gets the job done. It doesn’t get the job done as well, but it gets it done. Two, and far less common than laziness, is that you are malicious. As above you know there is a good solution but for some reason, you purposely don’t want to do it that way. Maybe because you don’t want to fix your own earlier mistake, you don’t like taking orders from your boss, or a colleague you don’t like suggested the correct solution and you are petty and self-centered. For whatever reason you are being malicious when conciously choosing to implement the wrong solution (even if it actually takes longer) for reasons like the ones above and that is obviously not doing the right thing, on so many levels. BTW, it isn’t necessarily that you are outlandishly lazy or malicious yourself, it may just be that your workplace doesn’t make it easy not to be lazy or malicious. This leads to people being lazy or malicious. As often occurs in life, people tend not to question the status quo and so if software is being developed in such a way as to not encourage doing things right the first time, then most people will likely not do things right the first time. Aren’t we humans wonderful? So my advice is don’t be lazy or malicious. Do it right the first time.
Second, when I say “Be open to mistakes and learn from them” I mean that even if you aren’t lazy and malicious and you try to do things right the first time, you are going to make mistakes. That is because you don’t know everything there is to know. And I’ll let you in on a little secret – neither does anyone else. Even the smart people don’t know everything there is to know. So don’t let that fact worry you. However, once you accept that you don’t know everything there is to know, then you have to accept that you will make mistakes. There is no getting around it. Doing anything non-trivial in software is hard (and don’t even get me started on life). We haven’t been doing this for very long and this industry changes so quickly that no one has enough software development knowledge to never make mistakes. The question then becomes how do deal with these mistakes. And my advice is to learn from them and don’t make them again. Otherwise, you are just wasting your time. Mistakes themselves are not bad (unless they are the kind that kill people or something, but in that case you have a serious quality assurance issue). What is bad is not learning from your mistakes and not using the experience to build better software with fewer mistakes in subsequent projects. I once made a mistake that cost somewhere in the neighborhood of 50 person days to find and fix (that’s probably in the range of $10K – 15K in developer salary alone). And it was a stupid stupid mistake too. Of course I felt stupid at the time, but let me tell you, I’m never going to make the same mistake ever again (and I now have a specific type of bug named after me 🙂 ). And in fact, there is a whole class of coding errors that I will forever be wary of making because of this experience. The point is that people make mistakes. Rather than being afraid of them, we should be ready to deal with them and willing to learn from them.
I don’t believe that “Do it right the first time” and “Be open and learn from your mistakes” are actually contradictory. Mistakes are going to be made. Accept it. However, do the absolute best job you can do the first time you implement a solution. Use the mistakes made to increase your experience so that the next solution your work on will have an even better “first time” solution.