Refactoring Changes
February 18, 2025
Software DevelopmentOne of the big changes I’m making to my coding routine this year is this: Before adding a new feature, the first question I ask is “Is the current design the best design it can be to make this change?” If the answer is yes, proceed with adding the feature. If no, then I refactor the code to improve its design, and then add the feature.
As Kent Beck (author of TDD and Extreme Programming) says:
“For each desired change, make the change easy (warning: this may be hard), then make the easy change.”
This sounds like a lot of work on the surface; and in the beginning, it is. However, in practice, if you keep making these small, continuous refactorings to keep your codebase in a high-quality state, you will find that it makes future changes much smoother. In a short time after I started following this approach, I’ve already started noticing the benefits in my projects - it just works. I highly suggest you give it a try.