Rewriting 15-Year-Old Code
summary
A practical playbook for fixing old web apps: module-by-module rewrites, not risky full rewrites, with an actual billing module rewritten in about a 40-hour rewrite that recovers ~15% lost revenue; migration tactics include an ASP Classic → PHP path using a session adapter and HTTP comparison tests, automated tests for extracted methods, and backups with anonymized data. Design work uses design extraction from live code, method extraction to tame huge functions, and hunts that found 1.5 million lines and 60,000-line duplications.
AI-written summary · about
chapters (21)
- 0:00Intro
- 1:29Feeling Old Yet?
- 4:04Mixed Concerns
- 5:01Poorly Named Variables
- 6:31Global Functions & Constants
- 9:19Inexplicable Conditions
- 11:41Average Legacy Code File
- 13:02Codebase
- 14:08Strategy
- 19:04Data Can Be Lost, Stuff Can Break
- 23:57Build With Real Legacy Data
- 25:51PHP 3 to PHP 5.6
- 30:45Avoid Code Bias
- 33:15Code Duplication
- 34:56Fix Long Methods
- 36:48Spot Logical Groups
- 38:38Extract & Test
- 41:02Solution
- 43:12Guzzle Tests
- 45:06Testing Static Methods
- 50:59Takeaways
related talks
53mPorting Code - Lessons Learned
36mRewrite, Rework or Refactor
40mRefactoring Huge Legacy PHP Applications - From 100 hours to minutes
20mLegacy Migration... Differently
01h 47mClean code
48mContinuous Modernization
01h 29mAlchemical Code Rejuvenation
55mModernizing Legacy Code - While Not Bringing Down Prod
