The creative process of coding

Posted on December 4, 2004

You have a problem to solve.

You get the problem in your head and mull over it for a while, trying to consider all the angles.

You then consider the alternative ways you have to solve it. Like a good little programmer you think about what every possible alternative has going for and against it.

You start to make some tests and experiment a bit.

You make up your mind. This is “The Way” you say. You know what you are talking about, you’ve considered it, you covered all aspects, you tried it out you are in control, you are “the man”!

So now all you have to do is implement the thing and get on with your life.

And so you do it.

Only it doesn’t quite come together as you expected it.

Still, you know this is “The Way”, so you toil on, on the face of adversity and you make it work.

Well… Almost, it still doesn’t quite work. And what you ended up doing to the poor code? Man, you should be arrested! Beware the style police, you may never be able to show your face again to your fellow coders…

So you pause and think about it. You know you’ve messed up the implementation somehow, but how?

And one day you are hit on the head by a shovel (weeeell… it feels like it anyway) and you realize: “OMG, what was I thinking??” (yes, in your desperation you start talking like a l33t t33n, go figure…). The way to solve the problem, the better way, has just snuck up on you and is there in your brain, staring at you, making fun of you, calling you stupid and other less family-blog friendly names…

So you go back, undo all the code murdering you’ve done and put in the new, oh so elegant solution.

Of course it works first time, it is fast, it is clean, it is extendable and it has the new super-duper GTI engine!

Well, it was obvious, wasn’t it? It was staring you in the face all that time. Still you had to go and spend all that time and do all that dirty work just to get to it.

And now that you’ve been through all that you just can’t help yourself jumping on to the next challenge. Only this time you’re going to get it right, plan better and the good, clean solution is going to be implemented first. Now you know better.

Or do you?

God, I love being a geek!