All laws

29Maintainability

Boy Scout Rule

Continuous Improvement.

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 Diff — cleanup riding along with a behaviour change hides the change, and a pull request that also renames forty things is one nobody reviews

Improve this article on GitHub