A short side note from a presentation I recently attended was so amusing that I had to comment on it. Basically, it described the progression of code from when you first write it to the best code it can be. It goes something like this:
- Crap - the first attempt, probably doesn't work
- Hack - ugly, unmaintainable code that hurts your eyes to look at it, but it works in the current configuration
- Spaghetti - somewhat configurable code that usually works, but is not robust
- Readable - robust code that works in most situations and is "pretty good"
- Elegant - the holy grail of code, perfectly OOP in all the right places, robustly (and simply) handles even edge cases with ease
It is important to remember that code does go through this maturing process. When you first write code, it is more important to explore the functionality than to write elegant, well-designed code. Trying to make perfectly elegant code in the first draft can easily turn into overengineered code that is a nightmare to maintain. Writing quick, crappy, hacked together code can allow an application to be evaluated... and can also be refactored into better code. That doesn't mean that we should strive to write crappy code. It just means that we should have tolerance for it because it hasn't yet matured into elegant code.
For a more serious explanation of the quality stages, read Watts S. Humphrey's article, A Personal Quality Strategy or the Wikipedia article on software quality. Another entertaining read is Senzee's post on A Developer's Life Stages.