Five Lines of Code
summary
Applies a concrete rule—five lines per method—and a low-risk refactoring flow that uses copying/pasting, the compiler and the type system (C#, enums → classes) so the compiler shows completion. Uses Improvement Mondays, ensemble programming and strong-style pairing to build practice and remove bus factors, deleted red tests/comments to reduce dead weight, and iteratively replaces switches and type codes with small, safe steps. The codebase becomes easier to change and the team more sought-after, though the project later runs out of funding.
AI-written summary · about
chapters (14)
- 0:00Intro
- 1:30A new project
- 3:36Dead weight
- 4:46Strong-style pairing
- 5:261 Safety
- 6:322 The code
- 7:333 The environment
- 11:344 The smells
- 14:35From smells to rules
- 14:57Five lines: Statement
- 15:33Example
- 23:36Type code elimination: Flow
- 29:19Trail map: Summary
- 31:55Outro
related talks
35mFive Lines of Codes
29m6 Safe Refactoring's for Untested Legacy Code
18mWriting Quality Code
42m6 Safe Refactorings for Untested Legacy Code
20mGood Code is a Balancing Act
35mQuickly and Safely Refactoring Legacy Code
10mThe clean code protocol
53mIntentional Code - Minimalism in a World of Dogmatic Design
