Getting it Wrong
Joe Rinehart has written a little blog entry entitled OO Design: Enjoy getting it wrong. In it he states that the mistakes we make, and we will make mistakes, in the designs we pick for OO projects are the best part of OO design. The reason he states for this is that it is the errors that force us to learn and to grow. And by confronting those errors we gain valuable insights that we can reuse on other projects.
This is definitely true in my coding and design experience. So I find that I agree with him for the most part. However, how does this work for beginners who may or may not have the experience to recognize where they made mistakes? If I code something that seems to work and looks correct to me, but is fundementaly wrong, how am I, a beginner, suppose to realize that it is wrong? This is where I am beginning to realize that things like code reviews and pair programming are indispensible for every IT department. The more people that are able to look at code, the more chance people have of realizing that something was done wrong and the more chance there is of finding someone who has the experience and knowledge to do it right.
In the fields of engineering and architecture, before a project can move from the design phase to production the design has to be certified. This usually involves other, more qualified, people inspecting the design according to a set of rules and principles.
Personally, I think this should exist in the world of programming. Every project should have to be inspected by as many people as possible before it is shipped out the door. Which is cheaper, to spend the money before it ships on code reviews that will catch a ton of bugs, or to spend the money on fixing bugs after the product ships? I don’t have an answer to that question, but I would like to know what it is. My guess is that the code reviews would end up being cheaper.
If the only way that I truely learn is through making mistakes, then I hope I make lots of them. However, I also hope that I have the wisdom and insight to realize that I have made them and to learn from each and every mistake. I don’t mind making them, I just mind making them twice.