DEV Community

Cover image for how much time do you dedicate to regularly refactoring your code?
Pankaj kumar
Pankaj kumar

Posted on

how much time do you dedicate to regularly refactoring your code?

Is it something that you prioritize or do you tend to put it off until it becomes a necessity? Let's discuss the importance of regular code refactoring and the benefits it can bring to a project."

Top comments (1)

Collapse
 
tracygjg profile image
Tracy Gilmore • Edited

Hi Pankaj,
A fine question to pose and would hazard the answer by many will be "not enough". A couple of points I think worth making are:

  1. If you do not have unit tests to help trap when your change breaks your code you are not refractoring, you are just changing code.
  2. I am agile development refactoring is not optional but essential to ensure the code base is clean and lean in preparation for addressing the next priority. And to my previous point, that means unit tests are also essential to a robust agile development process. Regards, Tracy