Notes on Rewriting Software
Oct 1st, 2007 by phil
Adam Turoff wrote a very insightful post last month about rewriting software that seems very relevant given the recent furor over rewrites. Essentially, Adam is saying that it may in fact be OK to rewrite a piece of software and he mentions Firefox as an example of a rewrite that was successful.1
He follows up this month with an article titled “Rewriting Software, Part 2” wherein he makes the following observation:
If you are a writer, or have ever taken a writing class, you’ve probably come across John R. Trimble’s assertion that ‘all writing is rewriting.’ Isn’t it funny that software is something developers write yet fear rewriting?”
I am not a professional writer, but I do have some interests in the area. I think the kind of “rewriting” that Trimble is referring to is more like editing and tweaking than throwing the whole manuscript out and starting over from scratch. From what I understand of writing you start out with a draft that sucks and gradually massage it into something that you can call finished.
This type of rewriting is closer to the agile approach of creating the simplest thing that could possibly work and then building on that foundation. What happened with Firefox and CDBaby are “big bang” rewrites where the developers abandoned a working codebase and started over from scratch. In the case of Firefox it worked out OK in the end, but things were touch and go for a while. It didn’t work out at all for CDBaby.2
Adam follows the previous quote with this:
There’s a deep seated prejudice in this industry against taking a working piece of software and tinkering with it, except when it involves fixing a bug or adding a feature. It doesn’t matter if we’re talking about some small-scale refactoring, rewriting an entire project from scratch, or something in between.
I think it is a mistake to lump refactoring, minor rewrites and big bang rewrites into one category. Refactoring and agile methods for evolving a codebase are gaining acceptance while successful big bang rewrites are the exception and not the rule. What this shows is that if you feel that you need to rewrite a piece of software you are more likely to be successful if you do the rewrite in smaller iterations. Also, if you feel the need to make architectural changes or to switch to a different technology you will be better off if you do one at a time.





Regarding PS#2. CDBaby was not re-written from scratch the second time around. It was rewritten as you state it, by taking a rough-edged but working piece of software and polishing it with some new techniques to make it shine.
Nice post - I enjoyed reading it.
By the way, your feed link is broken. It’s showing up as this for me:
http://fiatdev.com/
Ok, so your comments form garbled the URL. Hopefully this will make it through :-)
http://fiatdev.com/%3C?php%20bloginfo(‘rss2_url’);%20?%3E
@Guy Doh! I fixed the feed link. Thanks for the heads up!
@ “From what I understand of writing you start out with a draft that sucks and gradually massage it into something that you can call finished.”
Couldn’t have summed that up better myself. Except that in my case it still sucks. =P
Enjoyed your post Phil.