Using existing code is right, usually

Chris Smith wrote a great post last week about the importance of other people’s hard work. In general, he’s right.  Our industry has a sad reputation of developers throwing away other work so they can do it themselves. It’s common enough to have an acronym: NIH for “Not Invented Here”. We all need to do a better job of reusing work. It’s a more efficient way to create software.

That being said, I like to discuss this issue with customers in a slightly different way.  Code, like a building, in an asset. If cared for, it’s a smart decision to invest in its continued upkeep, and enhancement. Put on an addition; remodel the kitchen. That’s money well spent. It’s cheaper than the alternative, and less disruptive.

On the other hand, if this asset has been left to languish, it’s value diminishes. If left in disrepair long enough, it becomes wiser to tear it down and build anew. With buildings, it’s a tough call, but the effects of that neglect are visible.

With software assets, it’s tougher to see the signs of neglect. But they do exist. How many tests no longer pass, and no one cares because “that test isn’t relevant anymore.” Or worse, how much of the codebase doesn’t have tests? Did this code base ever get released? Has it been refactored over its life to reflect modern idioms and techniques?

It’s a difficult problem, and I’m certain we don’t get it right every time. Chris accurately represents one time when leveraging other work would have been better than the path chosen. Other times, we’ve wondered if we should have scrapped a bad codebase right at the start. No matter what we choose, this will always be a difficult decision.

Therefore, the best advice I can give is for those of us that manage existing code bases:  Treat them like the investment they are, and then it’s easier to convince everyone that you should continue to invest in them, rather then tear them down.

Created: 7/26/2011 11:11:25 AM

Current Projects

I create content for .NET Core. My work appears in the .NET Core documentation site. I'm primarily responsible for the section that will help you learn C#.

All of these projects are Open Source (using the Creative Commons license for content, and the MIT license for code). If you would like to contribute, visit our GitHub Repository. Or, if you have questions, comments, or ideas for improvement, please create an issue for us.

I'm also the president of Humanitarian Toolbox. We build Open Source software that supports Humanitarian Disaster Relief efforts. We'd appreciate any help you can give to our projects. Look at our GitHub home page to see a list of our current projects. See what interests you, and dive in.

Or, if you have a group of volunteers, talk to us about hosting a codeathon event.