"Working Effectively with Legacy Code" of Michael Feathers30 Apr 2018
“For a long time it’s puzzled me that most books on software development processes talk about what to do when you are starting from a blank sheet of editor screen. It’s puzzled me because that’s not the most common situation that people write code in. Most people have to make changes to an existing code base, even if it’s their own. In an ideal world this code base is well designed and well factored, but we all know how often the ideal world appears in our career.
“So this book is important because it’s written from the perspective of what to do with an imperfect yet valuable code base.”
— Martin Fowler
That quote above is from the Foreword of the book “Object-Oriented Reengineering Patterns.”
In this book, Micheal Feather presents some techniques on how to reverse the rot in legacy code.
What is “legacy code”?
Micheal Feathers offers a very direct yet controversial definition:
“Legacy code is code without tests”
“Code without tests is bad code.
It doesn’t matter how well written it is; it doesn’t matter how pretty or object-oriented or well-encapsulated it is.
With tests, we can change the behavior of our code quickly and verifiably.
Without them, we really don’t know if our code is getting better or worse.”
Wow! It seems like Micheal Feathers value tests so highly as Uncle Bob does!
… We need to start writing tests for our code then!
But if you will not be convinced that writing tests are very important, this book will still help in changing your mindset about rotting legacy code — this book can give you hope that the rot is reversible.
I compiled some very interesting ideas I got from the book: Great Quotes from “Working Effectively with Legacy Code” by Michael Feathers.
In case you are still in doubt on whether it is worth spending time reading this book…
Many of our other masters highly recommend this book.
Uncle Bob Martin wrote the Foreword for the book:
“… It’s not enough to prevent the rot — you have to be able to reverse it. That’s what this book is about”
Every software developer should read this book, since every software developer is likely to spend a majority of their time working with legacy code.
And someone who is giving away books for free?… Jay Fields
“These books, all technical, are books that I think most programmers will benefit from reading.”
Scott Hanselman had an interview with Micheal Feathers here.