Chapter 6. Practice 3: Less Code

image with no caption

There is nothing so useless as doing efficiently that which should not be done at all.

Peter Drucker

Don’t panic. We’re not trying to put you out of a job. “Less code” isn’t about writing less software; it’s about getting the job done with fewer lines of code. It’s about eliminating unnecessary code and making the necessary code more efficient. It’s about keeping the codebase small while still delivering functionality (and thus value) to the customer.

Codebase size affects projects in several ways, the most obvious of which is the amount of time required to write the code. More lines of code mean more time spent writing them. But code size has farther-reaching effects as well, since larger codebases:

  • Typically mean more components, which in turn mean more connections between components and more integration effort.

  • Mean more errors, which mean longer bug lists and more debugging.

  • Are more difficult to understand, increasing the learning curve for new developers and for future maintenance efforts.

  • Have more “inertia,” which makes it more difficult to respond to change.

As large codebases drive more components, more bugs, and longer learning curves, they drive up both development and maintenance costs. The definition of waste in Lean development is anything that increases costs without providing value, so the costs resulting from developing and maintaining unnecessarily ...

Get The Art of Lean Software Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.