It is drummed into every aspiring developer that duplicating code is bad, and re-use is good. Seen from the organization hiring the developer, that is true. But seen from a developer under pressure to meet a deadline, it makes perfect sense to write his own code, even if the same functionality has been implemented before.
If you want to promote re-use across teams in your organization, you need to do three things:
- Document all services with examples. For REST web services, you can use a tool like Swagger.
- Implement the policy that old versions of services are not retired until nobody is calling them
- Enforce a policy of calling services instead of writing them over.
This is an excerpt from the monthly Technology That Fits newsletter. Sign up here.