The DRO Principle

I was reading through the Pragamatic Programmers’ List of Tips today, which is filled with fantastic, pithy advice. Undoubtably the most-quoted is the DRY principle: Don’t Repeat Yourself. More than just avoidance of code duplication, the principle states that:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

It occurred to me that there is another, similar principle that could make the list. DRO: Don’t Repeat Others. These days we as developers are spoilt by the richness of open source libraries that we can choose from. Still, at times we fall prey to NIH (Not Invented Here) Syndrome, and are tempted to write our own frameworks and libraries. When there is an established and well-maintained open source alternative, it is almost certainly a mistake to write your own. The advantages of reusing open source are plentiful, with the most important being:

  • Code for free. As obvious as you can get: code you reuse is code you don’t have to write. More importantly, it’s code you don’t have to debug.
  • Developers for free. A well-maintained open source project brings more than just the code. The developers will keep improving the code over time, and you can take advantage of those improvements.
  • Battle tested. A mature open source project will have been tested in the Real World. New code you write will take some time before it even reaches its first Real User for this acid test.
  • Low Risk. For the manager wary of not having the code under their complete control: you always have access to the code if absolutely necessary.

So next time NIH hits you, fight the temptation. And next time you are struggling with the learning curve of taking on a new library, persevere. Leveraging open source pays: in the short term and more so over time.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg
  • DZone
  • Ma.gnolia
  • Reddit
  • Simpy
  • Slashdot
  • StumbleUpon
  • Technorati

Leave a Reply