Refactoring regrets

JW
Sep 3, 2021

Many times I find myself writing code, and coming upon a difficult problem I justify to myself “I will write it dirty now, but I will refactor it later”.

But a few weeks or months down the track I come back and look at my code and think “Crap, it is now really complicated. Maybe I shouldn’t refactor it?”.

Arguably the best time to refactor code is now while your brain is fully immeshed in the problem. Sure, it’s painful. But it will be easier now than later.

--

--

JW

Software Engineer, and avid learner of history.