My good friend Bob Martens just posted on his blog that he fears imperfection. Specifically when it comes to coding and programming. I have to say that I know this feeling as well. Though imperfection is not necessarily the term I would use. For me, the fear is efficiency.
Sure, I fear that my code will have some horribly exploitable bug and that’s one reason I typically don’t release it into the wild. But code is rarely efficient the first time through.
They say it takes three revisions to get your code correct. The first is testing, just to see what you can make happen. The second time you rewrite it, you know how it all works and you have a few new things. Either in the process of this or shortly after finishing, you learn a few new tricks or come up with some clever ways to do things. Hence, the third rewrite when everything is smooth.
Which is where I am on a personal coding project. The code is pretty solid. It’s not perfect, but it’s fairly clean and relatively pretty.
As such, I’m pretty happy with how the code is, but when I need to edit something, or add something… I hate the thought of adding kludgy patches onto the clean system I have developed.
I want my solutions to continue being elegant.
The process I have developed to help do this is simple, but steals a bit from the three rewrite rule.
Pseudo code. My first step is to plan everything out ahead of time. This is how most programing should be done first. Maybe it is. I know I don’t do it as much as I should.
Testing phase. I play around with some sample pages or projects to make sure everything works the way it is suppose to.
Rethinking phase. After I get a grasp about how the basics work, I step back to make sure it’s accomplishing my ultimate goal and then make sure I’m being as efficient as I can at the moment. (Could this be a function? Should this be an object?)
Implementing phase. Finally I add it all where it needs to be and make sure it works.
My guess is that this is not ground breaking. My guess is that any other coders do this all to some extent as well.
But the main point is the point Bob was trying to make. You just need to do.
Any maybe that “doing” is just breaking things down into OCD manageable chunks. And maybe it’s just creating a disaster so that you have something to work from. But the important thing is that you need to actually do it.
Pictures in your head don’t come to fruition by staring at a blank screen. Unless you dream about blank screens. I can create a hundred blank text files and they’ll all be perfect and pristine, but they won’t do me a lick of good unless I’m trying to create some form of modern art exhibit. (I’m calling DIBS on that idea.)
So stop waiting to be perfect and go out and DO something. That’s how you’ll get better.