You've started a new job. As you dig deeper into the codebase, the WTFs per minute rate rapidly increases, and you're left wondering... "Where do I start?!".
In this talk, I'll draw on my own experiences of joining several different teams to help upgrade their legacy codebase.
I'll show you what approaches were tried, what worked, what didn't work, and how things could've been done differently.
You'll come out of this talk with some ideas of how to tackle your own codebase and make it easier to refactor.
14. @asgrim
"Legacy"
Can mean...
● Old code
● Code that uses outdated patterns
● Obsolete (but still used)
● Difficult to maintain
● Uses old frameworks / libraries
● Fragile / untouchable
● Expensive to replace
15. @asgrim
"Legacy"
Can mean...
● Old code
● Code that uses outdated patterns
● Obsolete (but still used)
● Difficult to maintain
● Uses old frameworks / libraries
● Fragile / untouchable
● Expensive to replace
● Working code
● Code that (usually) still provides VALUE
● Code written an hour ago
16. @asgrim
"Code can be in two states:
in production
...or almost useless"
- Srdjan Vranac (@vranac)
65. @asgrim
To summarise...
"Legacy" !== "bad"
● It's just "existing code"
● If it's in production, it usually produces VALUE
How to tackle existing codebase?
● You don't always need to refactor
● Communicate - peers & business
● Produce documentation
● Learn to really READ code!
● Determine what produces VALUE (both business value + developer experience)
● Use tools to help improve code quality
● Characterise critical functionality with tests
● Build up your "test pyramid"
● Automate all the things!