OnRewrites

June 10, 2011
(This post partially sponsored by guys named Fowler)

ChadFowler has a series on rewriting applications on his blog (in progress at the moment). It got linked to from a PragProg mailing list discussion and I wanted to link to my blogki here with my own related references - except it seems I didn't have any. So, I'm collecting a few here that I can think of on the fly.

First is an article from MartinFowler called StranglerApplication, using a metaphor of Australian strangler vines. The idea is “to gradually create a new system around the edges of the old, letting it grow slowly over several years until the old system is strangled. Doing this sounds hard, but increasingly I think it's one of those things that isn't tried enough.”

JoelSpolsky was against Netscape's decision to rewrite (even after they survived the rewrite and created XUL in the process):
Netscape wasn't the first company to make this mistake. Borland made the same mistake when they bought Arago and tried to make it into dBase for Windows, a doomed project that took so long that Microsoft Access ate their lunch, then they made it again in rewriting Quattro Pro from scratch and astonishing people with how few features it had. Microsoft almost made the same mistake, trying to rewrite Word for Windows from scratch in a doomed project called Pyramid which was shut down, thrown away, and swept under the rug. Lucky for Microsoft, they had never stopped working on the old code base, so they had something to ship, making it merely a financial disaster, not a strategic one.

...

They shouldn't have rewritten from scratch. They should have done this all in steps. Big chunky steps, fine, but steps. For example, they could have rebuilt the rendering engine -- without touching any of the other stuff -- as a first step. Then ship. ... getting from a messy architecture to a nice architecture costs time, but it doesn't cost as much as starting from scratch did. Over the period of time between Netscape 4 and Mozilla 1 they could have had three releases and still be where they are now. No, way ahead. And we'd have a real browser ecology instead of monoculture.

He followed it with a post containing some quotes from one of the original Navigator programmers, Lou Montulli:
I agree completely, it's one of the major reasons I resigned from Netscape. ... I laughed heartily as I got questions from one of my former employees about FTP code the he was rewriting. It had taken 3 years of tuning to get code that could read the 60 different types of FTP servers, those 5000 lines of code may have looked ugly, but at least they worked.


http://books.slashdot.org/comments.pl?sid=979493&cid=25194819

Another quote on the subject from Michael Feathers:
It's never a simple call [rewrite vs. refactor]. Usually, this is because the reason that people want to rewrite code is because they don't understand it. Yet, rewriting code often requires us to understand it well enough to proceed with the rewrite, especially if there are existing customers who depend on all of the nuances of behavior that the system has consistently exhibited.

tags: ComputersAndTechnology