Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

1  
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
2  
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 techrepublic.com/blog/programming-and-development/…). 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

1 Answer 1

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.