Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

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

This question already has an answer here:

Consider the following scenario.

You currently have a feature set A you wish to extend to include feature set B. In the near feature there's a high possibility that you wish to extend this even further to include feature set C.

  • Option 1) Cost to extend A -> B is minimal, but high maintenance costs.
  • Option 2) Cost to refactor A and B to make more logical sense is moderate, but low maintenance costs.

Extending to include feature set C:

  • Cost to extend refactored(A & B) -> C is minimal, again low maintenance costs.
  • Cost to extend A,B -> C is high, (both to refactor and extend).

Assuming the inclusion of feature set C is beyond the scope of the current sprint, how do you go about choosing an option?

How does this change if the addition of feature set C is several (2 or more) sprints out?

share|improve this question

marked as duplicate by gnat, Jalayn, Martijn Pieters, pdr, Kilian Foth Apr 4 '13 at 9:02

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.

The obvious course of action is to refactor first. The only reason that doesn't always occur is time constraints. – Robert Harvey Apr 3 '13 at 19:57
As others pointed out, it is better to refactor as soon as possible because refactoring becomes more expensive later. Another measure is to design your components as small and independent from each other as possible, to minimize refactoring. Some consider excessive need for refactoring an indication of poor design (see e.g. the last paragraphs of…). This is not necessarily the case in your situation, but it can be worth checking it. – Giorgio Apr 3 '13 at 20:11
possible duplicate of Agile estimation with tech-debt and of Rule of thumb for cost vs. savings for code re-use – gnat Apr 3 '13 at 21:42
up vote 4 down vote accepted

The longer you keep the debt the higher the accumulated interest. It's almost always better to pay off now.

share|improve this answer

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