Refactoring from Good to Great
summary
Live coding refactors Ruby code into clearer objects and fewer conditionals: extracting an orders query, adding a DateRange value object, moving date logic off Order, and replacing nil checks with a NullContact class which removes three conditionals. Tests run frequently and stay green while vim macros speed edits. A simple payment gateway abstraction centralizes BrainTree calls to avoid shotgun surgery and makes stubbing and testing easy. Concrete wins: smaller methods, lower coupling, and deleted code that still passes specs.
AI-written summary · about
chapters (13)
- 0:00Introduction to refactoring
- 2:58Extracting method
- 5:58Tell don't ask principle
- 8:47Extracting value objects
- 12:03Reducing code coupling
- 16:05Performance and code clarity
- 19:16Fixing edge cases
- 22:17Null object pattern
- 25:00Polymorphism over conditionals
- 28:57Organizing refactored code
- 31:14Depend on abstractions
- 35:02Implementing a gateway
- 37:44Refactoring strategies
related talks
47mRefactoring from Good to Great
48mRefactoring from Good to Great - A Live-Coding Odyssey
31mAn Optimistic Proposal for Making Horrible Code... Bearable
33mSo You Want to Start Refactoring?
40mWorkshop - Simplifying Code: Monster to Elegant in Less Than 5 steps
25mRefactoring: The ASMR of Programming Talks
28mFluent Refactoring
41mRefactoring Live: Primitive Obsession
