The so-called safe refactorings are a subset of the refactorings from Martin Fowler’s book, Refactoring: Changing the Design of Existing Code. We call them safe because they require only straightforward changes to code that can be automated and proven to be correct with no unintentional side-effects. Safe refactorings are refactorings like Rename Method that lets …
Continue reading “Refactor to Retrofit Tests in Legacy Code”
Read MoreAnother strategy to help you justify refactoring is to do it in order to make small improvements in an existing system. Don’t try to bite off the whole Apple at one time. Really bad legacy code got that way over long periods of time and in my experience, a similar, gradual approach can be good …
Continue reading “Refactor to Make Small Improvements”
Read MoreOne of the best opportunities to refactor code is when you’re starting to get to know it. This not only helps improve the code but it also improves your understanding of the code and helps everyone else who touches the code in the future. There are many kinds of refactorings that one can do to …
Continue reading “Refactor to Learn an Existing System”
Read MoreHaving put the words “legacy code” in the title of my book, people often confuse my book with Michael Feathers’ book, Working Effectively with Legacy Code. On one hand, it’s great to be in such esteemed company. I love Michael’s book and I refer to it often. It’s full of great techniques for taming legacy …
Continue reading “Why Practice 9: Refactor Legacy Code”
Read MoreAs you can see from my last seven blog posts, doing emergent design is not for beginners. Doing emergent design is an advanced development practice. But it’s not enough to know about good development principles and practices. It’s not enough to know about design patterns. We have to use them. We have to apply them. …
Continue reading “Practice Good Development Habits”
Read More