Is your code worthless?

Earlier in the week I was reading an old post by my new favourite blogger Dennis Forbes entitled Internal Code Reuse Considered Dangerous. It contained this gem:

The question every organization needs to ask itself, then, is what value they could sell their “reusable code” for - what, realistically, would competitors and new entrants in the field offer for it? The answer, in almost every case, is $0, and they wouldn’t want it even at that price. There is extraordinarily little code theft in this industry (even though we’re in the era of burnable DVDs and USB keys) because most code - above and beyond the industry-wide frameworks and libraries - has no value at all outside of a specific project with a specific group of developers. Trying to use it for other projects is often worse than starting with nothing at all.

This is something that I already sort of knew, but it’s the first time I’ve seen somebody express the idea so starkly. It seems very counterintuitive that something that is so difficult and expensive to create can have so little value. I guess that’s why so many organisations like to pretend that their code is much more valuable than it really is.

I first encountered this phenomenon a couple of years back when I was dispatched over 8,000 km from my beloved workstation to assist a customer with an integration project. They were attempting to integrate our product into their product and had run into a few difficulties. A manager at my company suggested that they send us the partially-completed integration, including their source code, so that our engineers could assist. The customer refused. They were jealously protective of their “intellectual property” and would not let any of it off-site.

Since this customer was a big fish, I was sent to complete the integration at the customer’s premises. I arrived on a Monday morning and was shown to my cube where the hardware I needed was already assembled. I sat down and fired up Vim to start looking at their code and was INSTANTANEOUSLY BLINDED by the reeking bile that was pouring across my monitor. Even if I or my company were interested in marketing a product that did the same thing as the customers product, the last thing we would ever do is steal this code. Incorporating their code into our product would have meant incorporting all their bugs into our product, and from the look of it there were probably a couple for every hundred lines.

Of course, the code was not worthless to the customer- it was in a successful product that was making them money. As Dennis says, it was just closely tied to “a specific project with a specific group of developers”.