By Joe Lencioni
It is fun to plant and harvest new crops in my garden, but I’ll eventually wake up to a mess if I don’t regularly weed. While each weed isn’t a problem by itself, they combine forces to choke the system. Working in a weed-free garden is a productive pleasure. Codebases are like this too.
I also don’t enjoy weeding, so I forget to and end up in trouble. Thankfully, in coding, we have great tools like ESLint and SCSS-Lint to ensure that we weed as we go. However, if we find large chunks of legacy code that deserve attention, we can be overwhelmed by the thought of manually tweaking a million spaces here and a gazillion dangling commas there.
After running a few codemods, our garden looks a little better:
Since most codemods take less than a minute with thousands of files, I find that codemodding is a great side-task while I wait for something on my main thread (e.g. code review). This helps maximize my productivity while making progress on bigger or more important projects.
The main challenges I’ve run into while working on large-scale refactorings usually revolve around the 4 C’s: Communication, Correctness, Code reviews, and (merge) Conflicts. I’ve used some of the following tactics to help minimize these challenges.
Read more @ Medium