Refactoring is rarely “necessary” or “urgent”


Refactoring is rarely “necessary” or “urgent”.

Yet refactoring is important because code is read often, and patterns proliferate.

If we only change code when we “must”, then anti-patterns and hacks proliferate.

So I try to improve the code I’m working with a little each day.
Related: I don’t ask for permission to refactor. I do it in small, incremental ways, so it doesn’t significantly impact timelines.

Refactoring while coding is like cleaning my kitchen while cooking.

A clean workspace makes it easier to do my job.

View original on X