All The Little Things
summary
Uses the Gilded Rose kata and test suite to show concrete refactorings: runs Flog to measure complexity (original class Flog ~250, tick ~245), applies a squint test, creates a seam to trap behavior, extracts one-class-per-item objects, turns the name-to-class mapping into configuration, and implements the missing "conjured" tests. Intermediate steps spike complexity but final code reduces average Flog by about 75% and all tests pass, producing small interchangeable objects that are easier to reason about and extend.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:37The problem of complex code
- 4:20Measuring code complexity
- 7:08The squint test method
- 8:39Testing legacy code
- 12:35Refactoring for clarity
- 17:01Replacing conditionals
- 20:03Creating small objects
- 23:34Extracting item behavior
- 25:51Implementing the factory
- 29:16Inheritance vs composition
- 32:57Final refactoring results
- 35:05Key design principles
- 37:26Conclusion and tribute
related talks
55mAll TheLittle Things
42mThe four rules of simple design
48mTwenty years of the four rules of simple design
30mOverkill
02h 42mClean Code: The Next Chapter
32mKeeping your code strong
01h 11mClean Coders Hate What Happens to Your Code When You Use These Enterprise Programming Tricks
50mWriting Solid Ruby Code
