Imagine you work for a small lean software company. You know the future competitiveness of the company is in having a good reusable code base to draw upon. It’s going to be very important to manage the company’s re-use policy to ensure you deliver today, at the same time as providing a back-bone for the future.
In my mind there are two reasons to write re-usable code in business; 1) To share within the company to improve speed and efficiency in the future 2) To publish on the web and other people will help improve the code (crowd-sourcing in a sense).
Developers should always apply common sense to re-use of course. But to get a handle on this from a management perspective I want some overall code-reuse guidelines to ensure we are competitive now and in the future. These guidelines should encourage the developer to ask “Is my code a Candidate for Re-use?”. What should these guidelines say?
My initial thoughts: It’s not worth writing re-usable code at the lowest levels (e.g. I have some in-line code which adds a “’s” to the end of a string), there would be far too much of this code to even sift through and find that someone has already done it. It’s also not worth writing re-usable code at the top-most level i.e. the application because your customer reporting application would end up being genericised into a SQL client – useless to most users.
Main barriers to re-usable code: You can’t re-use it unless you know it exists; Trust – It’s been done but do you trust it?; Initial time taken to make the code generic/re-usable (and to document it).