The Best Book on Legacy Code I've Read Yet
You have inherited a Legacy System, what do you do now? How do you manage a successful modernization effort?
I've read several books on Legacy Code over the years and each has its own unique take:
- Working Effectively With Legacy Code - This book is really about getting Legacy Code under test so that you can make changes without fear of breaking things.
- Technical Debt in Practice - This book is very academic. What it attempts to do is categorize the different types of technical debt. It's not just about poorly written code, you can have documentation debt, testing debt, requirements debt, etc. It talks a little about how to pay off the debt and the advice isn't very practical.
- Refactoring - This book is about the process of actually changing the structure of the code to make it more readable and maintainable. It talks a lot about code smells, which is a way to recognize when something needs to be changed, and refactoring patterns which are specific patterns to follow when making changes.
- Legacy Code First Aid Kit - This book is a set of very practical tools for dealing with Legacy Code. Some are very much head down in the code with specific refactorings and some rise to the level of strategy such as the Mikado Method or hotspot analysis.
What makes this book different?
"Working Effectively With Legacy Code", "Refactoring", and "Legacy Code First Aid Kit" are all very close to the code. Their intended audience is really developers. The techniques they discuss are really developer-centric techniques. "Technical Debt In Practice" tries to rise above that to an organizational level. It talks about the different ways in which organizations can accumulate debt. What it is missing though is practical advice on how to repay the debt. This is where "Kill it With Fire" comes in.
"Kill it With Fire" takes a much more holistic view of the situation. It starts with talking about the legacy of Legacy Code Systems. How and why have we ended up with these Legacy Systems? What are the various technological, societal, and organizational forces at play? What are our options for dealing with Legacy Systems? When does it make sense to rewrite or refactor? Should we even do anything?
Whereas many Legacy Code books are aimed at developers, "Kill It With Fire" squarely aims at tech leads, product managers, and CTOs. It talks a lot more about the business side of Legacy Code and how to build a business case for modernization. It talks about the incentive structure and how to incentivize the correct behavior. It talks about how to overcome inertia and build momentum. It gets into coalition building, managing expectations, how best to communicate progress, and all the other non-coding skills that are needed for a successful modernization project. If you are in charge of a modernization project, you can't afford not to read this book!