Write the first one ugly

The desire for perfection can paralyze software developers. Sometimes we know the gist of what we want to write but not which names to use or the constructs to define. So we stare at our blank screen and cogitate. We ponder, pondering our pondering, and ponder our pondering of our pondering.

To overcome paralysis, for small chunks of code, it is often better to just write whatever comes to mind – no matter how awful it may seem at the time. Give yourself permission to let the first version suck. You may even *gasp* not TDD (“Test Driven Development”) it. Just make it work. Just do it. You’re only pushing bits around on a screen. You can change it later! For those of you who always always always test first, this may even feel a little liberating (while feeling a tad naughty in a good way).

This is not software development technique. This is a productivity technique, pure and simple, straight from the writing of David Allen of Getting Things Done.

Also this is not just spiking. Spiking is, essentially, prototyping a small problem area for learning purposes. We’re not going in planning to throw code away – only our standards but only for a few minutes.

At the very least, this approach will serve the same purpose as a spike. You’ll better bound the problem, you may have a partial or working solution, but you have concretely captured the problem at hand. It sure beats the alternative of having an amorphous concept bouncing around your noggin.

How often do I do this? All of the time. For every piece of code, blog post, or email that I write, I blurt out whatever comes to mind first then I refactor (although, yes, I often, but not always TDD it when writing code). And when I refactor, yes, my standards come back into play. It works. Try it.

Posted by evan on Monday, July 26, 2010

blog comments powered by Disqus