How To Do Refactoring the Right Way

Refactoring is not an option. It is a necessity.

Jozef Lami
4 min readNov 13, 2021
Photo by Timo Volz on Unsplash

Refactoring is essential for the quality of software products. There is no way around it. You may take steps to avoid or postpone big refactorings with proper application design using appropriate software paradigms. Still, you will never be able to mitigate the need for refactoring completely.

There are multiple reasons for that:

  1. Change of requirements
  2. New technologies
  3. Scaling
  4. Prototyping
  5. Deadlines
  6. Wrong abstractions and mistakes in software design

The idea that you would build on previously programmed without ever reconsidering them is nonrealistic. We should count refactoring as part of our daily jobs. Otherways management will blame us for prolonging deadlines and inability to add simple features. So it is on us to take responsibility for the state of code and don’t allow anyone to take “shortcuts.”

How to introduce refactoring?

You could do minor refactorings in regular tasks (scrum) without noticing management, but that is not always the case. You can also make some more significant refactoring as a prerequisite for the next…

--

--