Small Victories: The Perptual Coding Machine

methodology

Sun Nov 11 17:43:00 -0800 2007

In the few years I’ve been practicing atomic coding, its usefulness never ceases to astound me. I’m exaggerating only a little when I say that I’m not sure how anyone ever manages to write software any other way. I think that this single practice gives me more productivity than any other methodology, tool, or technique in my arsenal.

One of the more subtle benefits of atomic coding is the momentum it seems to produce, almost as a byproduct. For example, let’s say I take a component and plan to make my first (sub)iteration be something that I think will take me about 3 hours. Seems like a good chunk, right? It can be done in a day but is a big enough chunk to feel like I can really sink my teeth into the problem.

Except that we all know programmers are perpetual optimists, no matter how many times we’re proven wrong. An estimate of 3 hours will really turn out to be more like 4 or 5. (This is because we’re estimating for the best possible case where nothing goes wrong, which rarely happens.) Even 4 hours of work is a pretty good chunk of the workday. When you’re finished, you’re certainly not going to want to start on another 4 - 5 hour chunk.

On the other hand, if you’re using atomic coding correctly, you should be carving off subiterations of 20 - 30 minutes at a time. Which really means 45 minutes to an hour, of course, but that’s still short enough that when you finish, you’re not afraid to dive into the next chunk. Better yet, you’ve got that little serotonin rush resulting from having created a useful, working piece of functionality and committed it to the repository. You’re excited and invigorated to dive into the next chunk - which you estimate at a mere 20 or 30 minutes of work.

The momentum produced by this stream of small victories means you’ll produce more output. A 3 hour chunk turns into 5 hours and then you have to quit for the day (maybe just catch up on email or whatever till quitting time). A stream of one hour chunks means that you’ll keep working past the 5 hour mark, filling the time right up until when it’s time to leave.