O'Reilly logo

Building Maintainable Software, Java Edition by Gijs Wijnholds, Pascal van Eck, Rob van der Leek, Sylvan Rigal, Joost Visser

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Keep Your Codebase Small

Program complexity grows until it exceeds the capability of the programmer who must maintain it.

7th Law of Computer Programming

Guideline:

  • Keep your codebase as small as feasible.

  • Do this by avoiding codebase growth and actively reducing system size.

  • This improves maintainability because having a small product, project, and team is a success factor.

A codebase is a collection of source code that is stored in one repository, can be compiled and deployed independently, and is maintained by one team. A system has at least one codebase. Larger systems sometimes have more than one codebase. A typical example is packaged software. There may be a codebase for the standard functionality, and there are different, independently maintained codebases for customer- or market-specific plugins.

Given two systems with the same functionality, in which one has a small codebase and the other has a large codebase, you surely would prefer the small system. In a small system it is easier to search through, analyze, and understand code. If you modify something, it is easier to tell whether the change has effects elsewhere in the system. This ease of maintenance leads to fewer mistakes and lower costs. That much is obvious.

Motivation

Software development and maintenance become increasingly hard with growing system size. Building larger systems requires larger teams and longer-lasting projects, which bring additional overhead and risks of (project) failure. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required