Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Best supporting argument for refactoring

Has anyone got any tips for persuading management that refactoring code is a good idea ? I was asked something like

"After this refactoring, will I have a better product ? How does time spent on this benefit the company?"

Or something along those lines. I can see why management asked it but my response was not fantastic. I said something about how a well designed piece of software will mean that adding new features in the future will be quicker and easier.

Does anyone else have any tips ?

Many thanks.

share|improve this question

marked as duplicate by Jalayn, jk., gnat, Péter Török, pdr Oct 3 '12 at 8:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Don't bother.

Rather than selling refactoring as a stand alone feature combine refactoring into your estimates for implementing fixes/ new features when it makes sense to do so, generally speaking the business need not and does not want to know exactly how you plan on implementing a feature, just that it gets done.

share|improve this answer
redesign however is different, you will need management by in then – jk. Oct 3 '12 at 8:14
I basically agree, but unfortunately it is not always that simple :-( If you have a large heap of legacy spaghetti code, small scale refactoring to keep quality at its current level is not enough. You need a lot of extra refactoring time on top of "normal" development to visibly improve things. And a decision to spend so significant a portion of project time on refactoring should not be made by you, the developer alone (unless management is completely unreasonable - in which case it is probably better for you to look for a new workplace anyway). – Péter Török Oct 3 '12 at 8:43
@PéterTörök yes its arguable you are then straying from refactoring into redesign, so you'd probably approach this by trying to show a cost saving of the course of 1 or more development cycles rather than for an individual change, and yes it would need management by in. – jk. Oct 3 '12 at 8:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.