Coder’s Block

I have tried before to write about what makes programming hard. I’m not really happy with that post or the followup. I still believe that Complexity in all forms is the biggest problem thought its not the only one. Sometimes designing an algorithm can be really challenging even for something which feels pretty simple. Same goes for things like performance optimization. It can be pretty difficult to properly analyze a system to determine what parts are slowing it down even if the system (or at least the part of if you have any control over) is pretty small.

But even beyond all that, much of the time it seems that the really hard thing about building Software isn’t writing the code, it’s deciding what code to write.  Its one reason we see so many projects which amount to “X now written in Y”. The objective and scope are clear and easily understood. Lets fire up vim and have at it!

Currently I’m building a large software product, hoping to turn it into money in the future. I don’t have specific tasks or deadlines besides the ones I set for myself and I sometimes fall victim to Coder’s block. Writer’s block isn’t an inability to type – it is a failure to be able to decide what to type next. Coder’s Block is similar.  When I am stuck (aka. hitting Command-R on news.ycombinator.com) it is rarely because I am faced with something I don’t know how to do. It is way more likely that I just can’t decide which of three different methods I could use to do it.

One way I deal with this is I try to keep two different Todo lists. One is the hard decisions I still have to make about how the software should work (Ex. what is the best representation for a huge list of genomic variants). The other is just a list of things I can knock out whenever I am stuck on the first list (Ex. Fix the report CSS styles so they don’t look like crap).  When I was a manager, I tried to encourage this habit among the coders who worked for me, but It mostly came out like I was trying to make them double up on work. Um sorry.

Another technique is to just code your way out of it. This works pretty well for small to medium size blockages. The other day I was stuck trying to decide what kind of reporting system I wanted to build. I wasn’t getting anywhere in my head so I just starting using python to think with.  I think I have written it about 3 different ways in the past week but now I am pretty happy with the result.  It certainly is easier to play around with options and keep transforming your code using new technologies than It was trying to do this with a C++ app using Boost and other crap.

Sometimes it is hard to get up the desire to use either approach. That’s when it’s time to step away from the keyboard and go for a bike ride.  Sure you could sit there and refresh hacker news, but it will be there when you get back.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>