←Back to kills
Legacy Cleanup—2024—6 weeks
E-COMMERCE
A PHP codebase from 2008 that had survived 16 years, 23 developers, and countless prayers.
Node.jsTypeScriptPrismaNext.js
🪓KILLED: 200k lines of PHP
THE DISEASE
200,000 lines of PHP 5.2 code. The original developers retired. Comments included "// TODO: fix this before 2010" and "// I'm so sorry."
✕200k lines of spaghetti PHP
✕Comments were apologies
✕No tests (prayers don't count)
✕Database had 400 tables (90 unused)
✕One function was 3,000 lines long
THE SURGERY
01
Archaeology
Documented what the code actually did vs. what everyone thought it did. Different answers.
02
Extraction
Identified the 20% of code that did 80% of the work. The rest was dead.
03
Rebuild
Modern TypeScript + Next.js implementation. Same functionality, 12k lines.
04
Migration
Zero-downtime cutover. Customers didn't notice. That's the point.
THE AFTERMATH
From code archaeology project to a system developers actually want to work on. Hiring became 10x easier.
Codebase size
200k lines→12k lines
Page load time
8 seconds→0.5 seconds
Developer onboarding
3 months→1 week
Production incidents
Weekly→Monthly
"
I can finally show candidates our codebase without apologizing first.
Engineering Manager
E-Commerce Platform