Succession
summary
An end-to-end refactoring of a hard‑coded Ruby here‑doc becomes a concrete recipe: add a simple test, introduce a parallel implementation, isolate algorithmic pieces with case statements then extract a critter object and tiny Verse/Song classes, swap in the new code and watch tests pass. The process uses Ruby string formats, Enumerable#each_cons, incremental commits on GitHub and exercism.io for practice; the test suite even catches a surprising bug (wrong indefinite article) before feature work for jungle/ocean critters proceeds.
AI-written summary · about
chapters (12)
- 0:00Intro
- 1:58Edge cases
- 4:38spurious refactoring
- 6:17indirection
- 9:25duplication
- 12:50conditionals
- 18:09critter
- 25:36first class
- 29:14refactor
- 33:17shim
- 34:53simplicity for flexibility
- 36:48Kent Beck
related talks
29mLet’s refactor some Ruby code
50mWriting Solid Ruby Code
48mRefactoring from Good to Great - A Live-Coding Odyssey
28mRuby for your two internal programmers
36mWhat's Wrong With Ruby's Object Model (And Why That's a Good Thing)
32mruby best practice patterns
37mHow to Write Better Code Using Mutation Testing
01h 01mYou Can Test Anything
