Contents
A virtue of codebases which is present to the degree that it’s simple to add new features and it’s rare to have to make unexpected changes (such as dependencies breaking). shotgun surgery is a code smell indicating a lack of maintainability, where even a simple behavior change requires modifying a disproportionate number of places.
Code Stewardship
Chelsea Troy has a useful Rubric for Evaluating Team Members’ Contributions to a Maintainable Codebase in which she described code stewardship, the skillset related to preserving maintainability. In this skillset Troy includes:
- Writing discoverable code
- Making code flexible in the right places (though flexibility in the wrong places can lead to misuse and a greater maintenance burden) (examples needed!)
- Writing useful documentation for code, ideally that clarifies what the code itself and its tests cannot
- Writing tests that demonstrate how code works and that it works
- Teaching and Coaching teammates to convey context when code, tests, and documentation alone aren’t enough
More
- Habitable Code, a newsletter about writing code that’s easy to maintain