
Ask HN: When does a rewrite/refactor make sense? - achillesr
What is the biggest motivation for a major rewrite&#x2F;refactor?<p>I feel the effort and time it takes to rewrite Architectures and Applications (especially when the entire team thinks it has been poorly designed to scale) is too high and probably not worth for the current requirements of the stakeholders and users involved.<p>I&#x27;m just wondering whether rewriting or redesigning architectures to a great scale makes sense especially with stringent deadlines and expectations.<p>Joel Splosky&#x27;s blog post on &quot;Why rewrite is a mistake&quot; makes so much sense yet is a challenge on poorly designed codebases.<p>So, when does it all make sense to go ahead and rewrite?
======
tyger11
If you can quantify the amount of time & expense between the two, you get your
answer:

1) no rewrite but painful updates over x period of time (total) 2) painful
rewrite but easy updates over x period of time (total)

If the delta is small between the two, then think about how long you intend x
period of time to be - when does it make financial sense?

Also, be aware that painful update experience winds up costing you in
developer turnover. This can be a HUGE cost.

Short term thinking of "it's too painful to do a rewrite" has killed more
companies than I care to remember.

But you need to figure out how to glean realistic and correct numbers for
these things to justify EITHER decision. Neither option is always right - and
if someone is saying it is, that person needs to be jettisoned ASAP- they're
poisoning your well of information.

------
kstenerud
When the cost of failure is low.

Rewriting involves introducing new bugs and incompatibilities with existing
systems. It means delays, data corruptions, and failed milestones. It means
disrupted routines and failed expectations. It means pissing off a LOT of
people, and so the biggest risk is political. Chances are pretty high the
project will simply be canceled once people see it in action and understand
how difficult their lives will be during the "transition", which could span
years.

Don't rewrite a system people actually use. It'll be your head on the chopping
block.

