DEV Community


Discussion on: Management, Refactor, and Prune

aleksikauppila profile image
Aleksi Kauppila

Thanks for posting! I really enjoy this gardening metaphor.

Like pruning, refactoring is a periodical activity. We cannot be refactoring all the time, or we have no time for building the real thing.

I think refactoring can be done all the time. It even should be done all the time. There’s a lot of of misconception about refactoring where the thought is that refactoring is some Mid-size to big task.

I think it’s about applying tens or hundreds small refactorings over time. Every PR can contain anything from a single refactoring to more.

dsdshcym profile image
Yiming Chen Author

Yes, I definitely agree with you! We should refactor before & after we change the behaviour of our code. And we should apply multiple small refactorings so that the change to the behaviour is small too.

That being said,
what I meant by "all the time" was literally "all the time",
and by "refactoring", I meant changing code without changing its behaviour.
So if we spend 100% of our time refactoring, we cannot get anything done.

Forem Open with the Forem app