DEV Community

loading...

Discussion on: Do you schedule time and tasks for refactors?

Collapse
subbramanil profile image
Subbu Lakshmanan • Edited

In my understanding, it depends on the team dynamics (technology, skillset & timeline of the project, etc., ).

We have applied both approaches in our project. One instance, We were able to buy in the Product Manager's approval to do Code Refactoring as a separate task to increase the productivity (reduced time to fix bugs, test & release was the main driving point). But it took a while to do that, especially when people doesn't wanna make change to working product however ugly the code is. We had to explain the benefits that we would get out of the refactoring and we are glad that we did that. This was the image that we showed to PM.

Too Busy for Code refactoring

Also as we did the Code refactoring as a separate task, We realized that we could have avoided this separate undertaking if we were little proactive earlier. So as a team we have agreed to do careful refactoring frequently as we work. We do commit the refactoring as a separate commit and submit PR. But We agreed to keep it minimal.

Code Refactoring a Day

So far We have good success with the approach. As we started doing, the number of PRs for refactoring has declined steadily(fingers crossed).

P.S: To give perspective, We are a small team of 5 people(2 junior & 3 senior developers) working on android apps.