Wednesday, August 25, 2010

How much of your code is shipped?

Do you ship your code? If so, how much? Do you ship all of it, or only a fraction? The knee-jerk response is "of course we ship everything -- if we don't then we are inefficient".

On my current project, less than 100 percent of my code is shipped. I find that code that is not shipped falls into a few categories:

Early, wrong code Some code that I write is just plain wrong. It works for some cases but not all, and I eventually replace it.

Scaffolding Some of my code is not part of the product, but serves an auxiliary purpose such as testing, test frameworks, or diagnostics. For example, when the project requires that we generate output in a non-obvious form, I write code that converts the non-obvious form into a readable form. This code is not part of the final product yet it is very useful during development.

Proof of concept Sometimes I create small programs to verify a design. These programs are small, stand-alone utilities that have a single purpose. They prove that the design works, and let us start building the real product.

API exploration Sometimes APIs are documented poorly. A small program to wrap the API and and let me try various operations is easier to manage that a large program. The experience gives me knowledge and confidence in the API.

You might have other categories. But others or not, non-shipping code is sometimes useful. Don't worry too much about non-shipping code, but don't ignore it either. Use it to improve your overall efficiency.



No comments: