Rewriting 15-Year-Old Code
summary
Claim: full rewrites almost always fail; progressive, feature-by-feature rewrites succeed. Concrete evidence: a codebase with 1.5 million lines, 5,000 classes and 20,000 methods yields a successful outcome when the billing module is rewritten in 40 hours, eliminating bugs and saving thousands. Techniques used include mod_rewrite and a session adapter to share sessions, Symfony migrations, HTTP-level tests with Guzzle/Behat, design extraction to write specs, and deduplication after finding the same bug copied ~80 times; the approach proves effective.
AI-written summary · about
chapters (31)
- 0:00Intro
- 0:38Anna Filina
- 1:22Yahoo 2000
- 2:22Legacy by Design
- 5:11Beware of the Dev Mode
- 7:30Long Methods
- 7:44Helper Classes
- 10:02The codebase itself
- 10:35Make a strategy
- 13:20Precautions
- 17:18Legacy Data
- 18:11Failed Rewrite
- 20:25Solution Rewrite
- 21:37Rewrite Size
- 22:25Design Extraction
- 24:34Deduplicate
- 27:40Logical Groups
- 29:36Rewrite Example 2
- 29:59Session Adapter
- 30:51HTTP Request
- 31:44Testing
- 32:07Static Methods
- 32:41Bounce Ideas
- 35:12Felina
- 35:34Questions
- 36:12Deleting code
- 37:03Completion of refactoring
- 38:32Impact of refactoring
- 39:45Garbage data
- 42:40Rewriting is impossible
- 44:23How to solve that
related talks
01h 02mRewriting 12-Year-Old Code
40mRefactoring Huge Legacy PHP Applications - From 100 hours to minutes
57mEating spaghetti with Symfony
31mLearn to appreciate legacy
57mRefactoring a large legacy PHP Application: a case study
52mRefactoring to Symfony Components
28mReformat, Refactor, Replace: A practical guide for dealing with legacy software
37mHow I Accidentally Wrote the Best Code of my Career
