views:

47

answers:

2

Everyone likes to talk about reusability. Where I work, whenever some new idea is being tossed around or tested out, the question of reusability always comes up. "We want to maximize our investment in this, let's make it reusable." "Reusability will bring higher quality with less work." And so on and so on.

What I've found is that when a reusable component or idea is introduced, everyone is immediately afraid of it and writes it off as a bad idea. Once applications become dependent on it, they say, it won't be maintainable, and any changes will result in the need to do regression testing on everything that uses it. People here point to one component in particular that has been around a long time and has a whole lot of dependents and grouse that it's become impossible to change becuase we don't know what the changes will break.

My responses to this complaint are:

  1. It's good that change to a component that has many dependents is slow, because it forces the designers to really think through the changes.
  2. Time should be taken to get the component right in the first place. Corrollary: If you're finding the need to change it all the time, it was never very reusable to begin with, was it?
  3. Software development is hard and requires work. So does testing. You just gotta do it.

Unfortunately, what people hear in these responses are "slow," "time" and "effort."

I would love if there was a magic "make this reusable" switch I could flip on things I build so as to win brownie points from management, but things don't work that way. Making something reusable takes time and effort and you're still not guaranteed to get it right.

How do you deal with the request for "reusability" when delivering on it seems to bring nothing but complaints?

A: 

One things that we often do is use versioning to avoid the constant retesting. Just because there is a new version of a common something doesn't me everything has to use the new version right away. When something is getting updated for other reasons, update to the new version of the common code.

aepheus
+1  A: 
  1. Reusability is only worthwhile if something will actually be reused. Make sure you have some practical reuse cases before you write something reusable.

  2. Even if a reusable library is 10x harder to maintain than an ad-hoc version of itself, you're still saving on maintenance overall if the reusable library is used in place of ad-hoc versions in 10 different places.

dsimcha