The Most Important Concept in Programming. PERIOD.

The Problem

Many programmers, including myself, run into a problem where, in the midst of writting their magnum opus, they realize that they learned a better way of doing everything that they just finished. Then, they start all over using this new amazing knowlege and half way through the rework they realize that there is a better way to apply the knowlege they learned on their last workthrough. So they scrap the 2nd iteration and redo the whole thing over and over again until they just quit on the project or lose interest.

The Right Way

After working on the same project for over a year and realizing one day that after several iterations of the early steps that you are no further along than you were a few months ago you start to feel discouraged. This is one of the biggest problems I, and other programmers like, me have when working on personal projects. We create our own deadline and as a result we don’t feel compelled to do what it takes to be done on time. We want to get it done once and get it done right no matter how long it takes. But what does exactly does right mean?

Many people will tell you that the right way to do something means that it works without any hiccups and it works fast. For the most part, this is correct. Programmers (especially newer ones) want to use the latest trick that they learned in their projects. For example, when I first learned that I can set flags in C++ to tell the compiler to only look at this code if I am in a debug version; I went nuts. I was like the little kid with a hammer, to me, everyting looked like a nail. I would use those flags everywhere without caring how unreadable my code was becoming. I kept with this until a good friend of mine (who happens to be a great programmer) told me that my code was ugly and dysfunctional. So I did the only logical thing to do. I threw away all my code and started from scratch.

I thought the right way was the prettiest, most advance, and elegant way and if my code didn’t match up to those expectations, I would scrap it and start over.

In programming, much like in life, something finished and ugly is better than something pretty and only one-fourth done.

The Solution

The only real solution to this is simply to force yourself to actually finish something. As a non-professional programmer or a professional programmer working on a personal project you simply have to force yourself to work through that last little bit of work until it’s finally finished and resist the urge to reinvent the wheel.