Refactoring is an important and continuous part of software development. The main reason is the continuous change in requirements, driven by the changes in the world around the applications that we build. Our clients keep learning about the ecosystem in which products work, and need us to adapt these products to the new reality they discover. As a result, our code, even when perfectly structured, is almost always behind our current understanding of the problems that we're solving.
Structuring our code perfectly is no easy feat either. Programmers are people, so we make mistakes, lose focus, and sometimes fail to find the best solutions. The only way to deal with this complex situation is by using merciless refactoring; that is, after we make things work, we improve the code structure until the code is as good as it can be under the...