Nerdy tidbits from my life as a software engineer

Friday, March 27, 2009

In Defense Of Not Invented Here

Is it really so bad to reinvent the wheel?  Most people would say, “yes!”, and I would mostly agree.  But like all things in life, I think there are right answers, there are wrong answers, and there are questions that have no real answer.

You might think that on the surface there’s no point in writing your own continuous integration solution when there’s CruiseControl.net. But what if CruiseControl can’t do something your build process needs it to do?  Or what if it could work that way, but it would require so much work and take up so much time that the cost of making it work properly would outweigh the benefits?  At some point, you may wisely evaluate your situation and realize that, as much as you wish you could reuse somebody else's work, it’s simply not possible.  And then you’ll end up writing your own continuous integration solution – perhaps hating the fact that you have to, or maybe enjoying the experience – instead of using somebody else's.

Is that really such a terrible waste of resources?  After all, aren’t you better off having a continuous build solution than not having one at all?  Why are we lamenting the fact that somebody’s not using a solution that’s already out there when they can’t use it in the first place!

There are some things in life I am not going to write myself.  Ever.  Examples of these programs are:

  1. My operating system.
  2. My compiler.
  3. My web browser.
  4. Adobe Photoshop.
  5. Video games (yes, I will pay $50.00 to play Half Life 2, thank you very much)
  6. My printer driver (unlike Richard Stallman, I have no interest in starting a revolution in order to get my printer working again.  Nope.  I’ll just buy a new printer).

And then there are examples of things I could write myself, if I really had to:

  1. My unit testing framework.
  2. Windows calculator.
  3. Notepad.
  4. My continuous integration server.
  5. My mock framework.

Now, just to clarify: I didn’t write the list above because I want to reinvent these applications / APIs.  On the contrary.  I would prefer – much prefer – to use somebody else’s software than to write it myself.  But the software I listed above I find so essential to my productivity that if I were ever in a situation where, for whatever reason, I simply couldn’t use an existing solution, I would find it worth my time to write one myself.

And yes, I might enjoy the experience…but that’s besides the point.

So here’s my conclusion.  The people who really abhor the NIH syndrome do so because they themselves are not in a situation where they have to reinvent the wheel.  They therefore cringe at any example of not invented here because they fail to see how anybody could be in a situation where they can’t reuse other people’s work.  The common misconception, I think, among this crowd is a belief that anybody exhibiting NIH is doing so because they like to reinvent the wheel.  And I’m sure there are instances in the world where people really do like to reinvent the wheel.  But in my experience, nobody wants to waste their time.  For the same reason I have no need to waste 4 years of my life writing my own C# compiler, I will happily use Visual Studio’s, even though it would be fun to write my own.

If we never have any competition in our industry, how could things get any better?  If new innovations and ideas come out of NIH projects, and other people benefit from them, can’t we be happy with that outcome?  And isn’t it a plus that we learn skills and techniques along the way?

And, if by reinventing the wheel but sharing the solution, we end up creating a system that other people who are in similar situations can benefit from, aren’t we making a net positive impact in the world?  Our custom continuous integration solution may have started just to benefit us, but if hundreds or thousands of people in similar situations can benefit from our system, I think we would have spent our time wisely.

0 comments: