When Is Reuse Feasible?
This post is triggered by a question from a friend. He is the CEO of a mid sized IT company based in India. What distinguishes this company is the fact that most of its revenue comes from IP created by them. He asked “Do you have any suggestions on how to create reusable assets and promote reuse among different product lines?”
I mumbled something about how reuse is difficult and how some of our large customers are also struggling with the idea. I doubt if I could convince him about the futility of attempt to reuse.
So I have decided to argue my case in this post.
- Effort required for reuse
- Opportunity to use code without making any modification is very rare. There is always some architectural variation between different product line / project.
- Effort required to modify an existing piece of code is much higher. If the change required is more than 20% then it may be easier to rewrite the code.
- To write a piece of code which can readily be reused requires significantly more effort – factor of 3 is a reasonable estimate.
- Therefore, to derive benefit the code needs to get used at least 4 to 5 times – so large number of product lines with identical technology is basic necessity for reuse.
- Pace of technology change
- Even with same basic technology, software version has to match for effective reuse.
- We live in a multi-tier world which uses a combination of different technologies – each of these technologies will have a significant new release every one to two years – therefore identical technology environment across product line is almost impossible.
- Open source software
- Availability of open source assets further restricts scope of reusable code – what can easily be reused will probably be available as open source.
Managers think that reuse does not happen because of “Not Created Here” syndrome.
However, the truth is that the way code is written reflects the thinking of the creator. To reuse any piece of code, I need to start thinking like the creator. If my requirement can be so well encapsulated that I do not need to understand the code, I can probably find something better in the web.
So, I think the only effective way of reusing code is to either include one of the creators or somebody who have already used that code as a part of the team.