Considering The Big Rewrite

by chromatic

Chad Fowler and Kevin Barnes recently considered the idea of The Big Rewrite:

I've most often seen the desire for The Big Rewrite where Technical Debt is so high that developers believe that throwing away the existing code and starting over is cheaper than fixing the problems in the code. It's technical bankruptcy.

Of course, if (like most developers) you can't actually read source code, your bankruptcy threshold will be awfully low--but that's another rant.

I very much appreciate how both Chad and Kevin analyze the other costs and drawbacks.


2007-01-23 11:11:56

Those are very interesting reads and certainly something I wish more people would pay attention to.

Of course, like anything, it seems to have odd exceptions. Perl's Test::Harness only has about 9,000 lines in its files (this is a raw line count, irrespective of what the lines are). Now while that's a pretty useless metric, it does give you an idea of how small the project is. However, there are two problems with refactoring it.

  1. It's absolutely critical to the Perl toolchain and therefore must not break.

  2. It's evolved over almost two decades and the responsibilities for accumulation, analysis, and presentation of test data were scattered throughout the code.

While there have been a number of attempts to refactor this code, they've generally met with limited success, partly because of problem #1.

While I started a rewrite, I also have to admit that I am doing this in my spare time and don't have budget or political pressures. This makes it much easier for the project to succeed, but I have to wonder, why has this taken so long? Why has no one stepped up to the plate to tackle this when it looks like a refactoring or even rewrite both seem like viable options?

I suspect the problem is that the refactorings have met with limited success (Test::Harness and TAPx::Parser are not "topologically equivalent, hence the rewrite) and there's such a strong "don't rewrite anything" imperative that this needed task has been delayed for far too long.

(That being said, it would have been delayed for far longer if Andy Armstrong++ hadn't stepped in to help.)

2007-01-24 12:59:11
@Ovid, I suspect another reason for the lack of refactoring is that right now Test::Harness works just well enough. It's not really quiet holding anything back, at least that people find compelling enough to change it.