When is the best time to consider software refactoring?

Should I refactor before adding new features to existing code or after the product has been delivered to the market?

Always be refactoring. Make sure that you allow yourself and/or your team enough time in your normal work to make improvements to the code as you go.

When it comes to large-scale refactor or redesign efforts, you kind of have to plan that the same way you would plan any other large piece of work. You consider the priority compared to other efforts, the relative effort, the risks and rewards, and then you plan it.

If the code needs to be refactored it is probably a good idea to do it before adding new features as they may depend on the implementation details of the refactored code.

Thank you all for the feedback

The best time for refactoring is before adding new features or updates to existing code. Doing so can help improve the product’s quality. By cleaning the code base before adding new features or updates, it helps to make the product more robust and easier to use in the future.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.