On my way to work today I decided that some major refactoring needed to be done to some code that I had written before.  There had been multiple changes made to the design and, due to time constraints, the code had not yet been cleaned up.  There was another developer who had been having trouble working with the code because, let's face it, most people don't write code the same way, even when there are standards for the company.  So in an attempt to make my life easier, my coworkers lives easier, and become a better programmer I started to clean house.

I realised soon after that scrubbing the code would also help to resolve a bug that affecting the program.  Which, of course, got me excited.  I just love it when things work .  So I talked to my boss for a minute about some of the changes that I thought we could make.  This is where things went bad.  He told me that "refactoring is a low priority right now".  Now, while refactoring is not the most important thing in the world alot of the time, it does make code more efficent and also could solve problems.  So i ask you, my fellow devs.......

As agile programmers how important is refactoring?  Is it something we should save for a rainy day, or something we should keep up on?  What do you think?

posted on Wednesday, April 30, 2008 9:37 AM

Comments

Gravatar
# re: Refactoring. High or low priority?
posted by David Meyer
on 5/1/2008 11:29 AM
Refactoring is generally a good investment, because it saves time in the long run. The one constant about software is that it's always changing. You can only account for so much change in your original design. Eventually, you're going to have to refactor in order to accomodate change in a maintainable way. I think some people mistakenly view refactoring as just making code prettier. They don't realize the time-saving potential and true long-term benefits. Refactoring should be considered a part of regular maintenance in order to promote better coding efficiency. As such, refactoring would take a higher priority the more a system changes.
Gravatar
# re: Refactoring. High or low priority?
on 5/1/2008 8:35 PM
I made a list of things I wanted to refactor on a current project a couple weeks ago and decided that I would get to it eventually... well yesterday, I receive a request for a new feature and was forced to do some of the refactoring. I'm wishing I had made those changes in the last couple of weeks... it would make delivering the new feature in the given time frame MUCH easier.

So, yeah, I think refactoring should be a high priority.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: