What is Tidy First?
Kent Beck's code maintenance methodology: make small structural improvements before behavior changes.
TL;DR: Kent Beck's code maintenance methodology. Small structural improvements before behavior changes. 15 tidying patterns (guard clause / extract helper / dead code / rename). Essential skill for AI agent code maintenance.
15 Tidyings
- Guard Clauses — early returns reduce nesting
- Dead code deletion
- Symmetry normalization
- Extract helper function
- Inline helper function
- Reorder statements
- Explicit parameters 8–15. Chunking / constants / renaming / dedup / simplify conditionals / flatten / split phase / introduce types
Rules
- Commit structure and behavior separately
- Each tidying < 10 lines of change
- Only tidy code you're about to modify