Things You Should Never Do, Part I
joelonsoftware.com
joelonsoftware.com
Evidence of this can be seen in the many examples of companies "buying out" an application by taking only the source and attempting to run with it. The results are rarely, if ever, spectacular.
Most of the application is in the minds of the developers. Take away his source and ask a developer to re-write an application and you are guaranteed to get a better program. Why? Because by the end of the project you know more than you did at the beginning, and when you re-write the code from scratch you can leverage this knowledge on all of the code, not just the code you wrote after you learned these lessons.
In this way it is impossible to re-write something (unless you are starting with new developers as well), just like if you asked Stephen King to re-write (as in, re-type) The Shining...
On the flip side, if you are able to keep your developers up to date on the codebase, you will save yourself a lot of trouble.
Well, not always. What about the edge cases the developer has long since forgotten? Unless you've also got a good test suite that covers those cases, you're exposing yourself to the risk of missing those edge cases in a sans-source re-write.
If this isn't the case, and you have the same core team available, then I agree, it is sometimes better to rewrite. But these days, refactoring techniques and testing methodologies are much more concretely defined and practice, so it still may be possible to essentially "rewrite" the code without having an X year shipping delay.
Joel's point is still valid, commercially it was suicide. 3D Realm's constant rewriting of Duke Nukem Forever bottom up is another topical reminder of just how stupid it is. Another dead company.
If you can rewrite and still release, rewrite away.
It is the same with Classic Mac -> OSX. The former was crumbling under its own weight but OSX enabled Apple to out innovate others.
The key point is that a rewrite should always produce something better and leaner. Two cases where it didn't happen are
* In case PG's viaweb -> Yahoo store. http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/m...
* When Sony acquired Naughty Dog. http://bc.tech.coop/blog/060118.html
The rewrite wasn't a clear loss -- especially if, as the postmortem suggests, there was exactly one person who was capable of modifying the old codebase. (Likely this is the same person being quoted in Bill Clementson's article, which suggests some amount of ownership bias. Come to think of it, the same could be said of the ViaWeb case...)
(I kid, I kid.)
In Apple's case the re-write idea turned out horribly and the only reason they made it thru is because a former founder had created a startup years earlier and had a working OS that Apple could buy and use.
Apple is hardly a poster child for re-writing software.
It looked cool, in the late 90s.
Of course those are just the starting points, from that a lot has been reworked/improved and a lot has been added.
I'll agree that in 95% of the cases it's not the right choice, though. We programmers do love us a good rewrite, even when it's bad for us. Incidentally, the Mozilla rewrite was probably in the 5% where it did make sense.
1. Is the whole code base a maintenance nightmare? 2. Do we have to change all of it right now?
Which occurs, rarely. Most of the time a mechanical transform (e.g. Emacs macro) helps with the annoyances and standards. The rest, a deep refactoring is needed.
Frankly, dumping the source and starting from scratch sounds a little like running away from your problems instead of attacking them head-on.
Joel's point stands - rewriting for the sake of rewriting is frequently a mistake. I know it was a huge mistake in the case of Delicious 2, for example. But that doesn't mean that starting from scratch is ALWAYS a mistake, etc, etc.
As a programmer and as a manager of a product, I think you basically need to try a bunch of things and get burned a bunch of times to properly learn when and where to do things.
Check out the comments they had to delete before releasing the code : http://www.jwz.org/doc/censorzilla.html .
It's true Netscape 4 lasted very long and was tough to improve, but I think that blaming Netscape for not having resources comparable to Microsoft is not entirely fair.
A rewrite is a risky proposition and should not be taken lightly. If Netscape did something wrong it was not to do it right after 4's launch.
He doesn't just imply it - he says it explicitly in another article of his [http://www.joelonsoftware.com/articles/fog0000000074.html]:
"When Microsoft released Internet Explorer 3.0, fast on the heels of IE 2.0, it was shocking just how good a job they had done. Not only did they replicate every feature in Netscape's browser, but they added some more features too, and did it all with an architecture that was robust and strategic. While it is true that Microsoft used its operating system to help push its browser, it is also true that they just wouldn't have gotten away with this if their browser wasn't great. (Case in point: even though Windows out of the box can play MP3 files, everyone I know uses WinAmp, not the Windows Media Player, to listen to them. Even though MSN is on the desktop, everybody uses AOL. Back when the browser integrated with Windows was crap, Netscape had 80% market share. So please stop fretting about the power of bundling.)"
And moreover, he's correct.
IE3 was the first "good enough" browser that came from Microsoft and, from 98 on, IE came bundled. For those who do not live in and for the web, "whatever comes with the computer" is what gets used. That was the last nail in Netscape's coffin.
MSN wasn't anywhere near as popular as AOL. But why not? After all, it satisifed your criterion, because it "came with the computer."
Also, MSN chat is nowhere near as popular as AOL Instant Messenger
Microsoft Money (bundled with my computer) isn't as popular as Quicken.
Microsoft Works isn't as popular as Microsoft Office.
and on and on and on...
The only way bundling matters is if the program being bundled falls into the category of "Good Enough" for the user in question. IE satisfied this criterion; MSN did not.
It's useful to get the app under a comprehensive test acceptance test suite. Then you can rewrite and feel comfortable everything is still working.
Here it is, enjoy: http://jasonmbaker.wordpress.com/2009/05/14/programming-and-...
The only way to overcome that is to do more rewrites :)
This is very good example of really smart approach. Another one is the reuse of Java/Eclipse ecosystem for Android development, same as Google App Engine Java. In both cases they rewrote VMs.
This man got his niche as a popular blogger and he is really good in that sort of blah-blah-blah re-telling-the-obvious-things posts.
But why here?