There is a reason that this book is on the recommend reading list of the ALT.NET Wiki. For some reason, I had this book lying around on my desk for almost a year before I started reading it. Since I finished reading it last week, I wished that I had read this book years ago.
The first question is: what is legacy code? Well, there are a lot of definitions going around, but legacy code is simply code without unit tests. We are talking about 99% of all the code bases on the planet. Should you read this book? Hell, yeah! The book teaches you a lot of dependency breaking techniques that you can use right away. The majority of the book describes these dependency breaking techniques and applies them to different scenarios with real-world code sample code mainly in Java and C++. Don't be scared! The most of it will also be applicable to your favorite .NET language as well. The last chapter (about 100 pages) is a nice reference to all the dependency breaking techniques.
I've seen my share of crappy legacy code over the past couple of years (some of which I wrote myself). Breaking down dependencies and get this code under test before adding new features is something you can start doing today. No more excuses of writing new code without unit tests. Pick up a copy of this book at your local dealer and read it from cover to cover. You will thank me later.
To wrap up this post, I want to share two quotes from the book that struck a nerve:
At this point in my career, I think I'm a much better programmer than I used to be, even though I know less about the details of each language I work in. Judgement is a key programming skill, and we can get into trouble when we try to act like super-smart programmers.
Programming is the art of doing one thing at a time.
Till next time