29

Maintainability

Boy Scout Rule

Continuous Improvement.

The article

If

Codebases decay because cleanup is always "someone else's job." Each engineer absorbs the entropy hit but defers the fix to a future refactor that never lands. The graph trends down.

Then

Always leave the code cleaner than you found it, and keep the cleanup small enough to read inside the same diff — a one-line rename, a clearer comment, a deleted dead branch. Anything bigger gets its own commit.

Unless

One Reason Per Diffcleanup riding along with a behaviour change hides the change, and a pull request that also renames forty things is one nobody reviews

Source

Robert C. Martin, The Boy Scout Rule, in Kevlin Henney (ed.), 97 Things Every Programmer Should Know (O'Reilly, 2010) — adapting Baden-Powell's "leave this world a little better than you found it". Also stated in Clean Code (2008).

Go to the source

See also