I was having a great conversation with one of my colleagues, Shoby, the other day. The conversation started by espousing the virtues of re-use in software engineering when compared to other engineering disciples such as mechanical engineering. I am going to come out and say it: re-use is over-rated in software engineering.
Before I get flamed for loosing my mind, let me explain by posing a question: What is more important: re-use or time to market?
Let's think about this statement for a moment. Sure, I admit, re-use may help us reduce time to market at times, especially if I am re-using someone elses' work (eg: an open source library I don't maintain, and was developed by a subject matter expert – In this case, re-use rocks!).
But does time to market imply re-use? No, and often it is counter productive.
I can't remember how many times in the past I spent additional hours making something more generic and 're-usable' only to find that by the time I needed to re-use it again, technology had evolved enough that there was a better, easier, simpler and smarter way to do the same thing. My theory is that re-use evolved into the holy grail in software engineering because things just became so hard to write the first time (can anyone spell E-J-Bs?).
So what's the solution? If you ask me, it is composable applications which are based on good design practices which allow you to swap libraries, change protocols, deploy your app somewhere different, or just plain start again and build it quicker and more efficiently than you could before. Refactoring of solutions should be a core principle, not an after thought. I am still amazed refactoring it is not a subject in itself in CS courses.
As Albert Einstein said, "Out of clutter, find simplicity."
This notion of ease of use is one of the things which attracted me to the Cloud, and in particular, Force.com and Heroku (and Ruby/Rails). I can't remember how many times I have torn down a schema I created in Force.com when a new requirement would be solved quicker with a new design, or by pushing a Rails app to Heroku without spending hours tweaking a web server config to support HTTPS. Or I want to improve app performance with a Memcache Add-on. Or spinning up some new dynos…. The list goes on!
In summary, yes re-use is important, but before you spend cycles coding a 'maybe' scenario, ask yourself if doing so will improve time to market. This reflection may help you identify open source libraries you could use instead, design patterns which will help you refactor in the future, and cloud services which change the way you build apps.