Of prototypes and tracer bullets

by

While we’ve been waiting to hear back about funding, I’ve been spending my time working on a prototype of our app. At least that was the plan.
My initial intent was to do a proper prototype. In other words, a throw-away version that I could learn from. In one sense, I was successful – the code I wrote let us get a good understanding of potential problems and sparked some great discussions. I feel like I understand the project a lot better now than when I started.
But, as I wrote the code, a funny thing happened. I got a few features done, but I wanted to flesh out the app a little more. So, I wrote a few tests to ensure I didn’t break core functionality and then added a few more features. Then I noticed some bugs that broke main scenarios, so I fixed those. Then I added another test, another feature, and fixed another bug. And somehow, little by little, the code became less like a prototype and more like a tracer bullet (the distinction is described in The Pragmatic Programmer).
Like any startup, our goal has always been to release early, and the iterate quickly. I started the prototype with that goal in mind. However, at this point, it’s surprising to me that the role of the prototype changed out from under me. We’ve had to ask ourself – should we throw away the code and write the production version from scratch, we we initially planned? Or use this code as a foundation for our real implementation?
It wasn’t immediately clear to us what to do – going down either path requires some work to get to a code base that we will be comfortable working with. The more we thought about it, the more we found that the answer lies somewhere in the following questions.
How much code have you written? Clearly, if you’ve written a lot of features that took a long time to write, you’ll prefer working with the existing code.
How good is the code? Although Joel famously stated that rewrites are a terrible mistake , he’s talking about mature software that already has a lot of bug fixes. If your code doesn’t have many fixes (and therefore still has a lot of bugs in all likelihood), has an architecture you know is flawed, or is just fully of hacky code, then perhaps you should lean towards a rewrite (you’re going to have to do a lot of refactoring just to get it in a good state anyway).
How many tests have you written? If you don’t have any tests, chances are you’ll have to refactor the code just to get the code under test. Then you’ll have to refactor more to get the code clean. It will probably be less work just to rewrite from scratch, baking in tests from the beginning. On the other hand, if you already have tests, refactoring will likely be a lot cheaper than a full rewrite.
What language/platform are you using? Clearly, if you wrote your prototype in a different language/platform than your real app, you’ll need to do a rewrite. We wrote our prototype in Ruby on Rails, because I know Ruby pretty well and knew that we could get something running quickly with Rails. Although RoR was a great system for writing a prototype quickly, we’re not sure if it’s going to be the fastest way to get a version 1.0 release (any advice on this is appreciated).
The lesson I’ve learned is to have specific goals in mind when writing a prototype. What exactly are you trying to learn from the prototype? How many features do you need to write? Which features can be faked? What can you avoid testing? If you don’t have some answers beforehand (both for yourself and others), you may end up writing something entirely different than you intended.

Advertisements

One Response to “Of prototypes and tracer bullets”

  1. Luke Pahler Says:

    I have a PDF that goes through all of the Java Web Frameworks and since RoR made a big dent in web world they asked Java Framework developers what they thought about it? Most said it’s great to get started QUICKLY and get most of the functionality done but it doesn’t scale…so you’ll regret it in the future.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: