The reason some code bases can’t be rewritten after a few years is because when the code was only three months old, the team passed on the chance to rewrite it while it was still a tractable exercise.
Why We Threw out All Our Code (And Why You Should Too)
21–30 of 66 posts
Re: Why We Threw out All Our Code (And Why You Should Too)
#22Maybe it is better. Maybe it is more stable, smaller, and faster, and well-tested. But it hasn't had as much "real world" use thrown at it as the previous codebase had.
I'm not saying I won't upgrade, but I'll likely wait a bit until I do and stay with what I know works right now, at least in production.
Re: Why We Threw out All Our Code (And Why You Should Too)
#233. Sunk costs and egos get in the way of good software Egos are what drive people to throw away their entire codebase and start over.
Re: Why We Threw out All Our Code (And Why You Should Too)
#24sigh; a headline like this is little more than HN linkbait. As others have mentioned, throwing out all your code is generally a bad idea, especially if your project is of significant size. How many lines is NowJS anyway? I doubt it was much of a loss.
Re: Why We Threw out All Our Code (And Why You Should Too)
#25Netscape 6.0 was a complete rewrite. The article claims that this was a mistake.
Now, if you would recall, one of the reasons Netscape 6.0 was completely rewritten was to use Raptor/NGLayout. Raptor/NGLayout was later renamed to Gecko. Gecko is the currently developed Firefox rendering engine, and Netscape 6.0 marked the start of the Mozilla foundation.
I would harshly argue that Gecko would not have taken off nearly as well without Netscape's rewrite. But this is definitely not a story about Gecko's popularity. It's about the reason why Gecko was the decision they took at the time, and the current impact of Gecko.
Besides the fact that Gecko was one of the early open-source success stories, the reason why Netscape decided to scrap everything and start from scratch was simple: Netscape 4.0 was horrid. Remember back to the days of IE vs Netscape. Netscape was significantly slower, and had no dynamic HTML among many other features. It was buggy and would crash frequently. And the development on the "continuation" of 4.0 code was simply too slow to compete, because of outdated, not modulated code, and stuff stuck in that simply "worked," and never changed to allow for future changes.
Now, people attribute Netscape 6 to Netscape's death because of this radical decision. But take a look at Netscape's usage statistics: http://upload.wikimedia.org/wikipedia/en/1/16/Netscape_Navig... . Hey, guess when Netscape 4.0 came out and IE started to dominate? 1996-1997. By 2000, when Netscape 6 was released, Netscape's usage already dwindled down to nothing.
Now, you're thinking, why didn't Gecko save Netscape? It takes too long to reverse these tides. Netscape was already dead. AOL acquired Netscape in 1998, to combat IE. Then, in 2003, AOL won an antitrust suit against Microsoft, and allowed AOL to use IE royalty-free. Netscape was pretty much scrapped at that moment because the damage had been done.
But wait.
Mozilla released Phoenix in 2004, based on Gecko. You should now the story from there. (Clue: Phoenix -> Firefox)
Disclaimer: I'm not saying that Firefox > IE or Chrome or whatever. I'm saying that the codebase Netscape 4.0 was based on was doomed to fail. Gecko still lives on today, and was started as a rewrite of Netscape.
Anyway, my point is, there are times to rewrite things, and there are times to keep them the same. If you have a good, legitimate reason to rewrite, as Netscape or NowJS did, you should. If you are just the stubborn programmer that always implements his own Queue or QuickSort when libraries exist, don't.
Re: Why We Threw out All Our Code (And Why You Should Too)
#26Re: Why We Threw out All Our Code (And Why You Should Too)
#27As perfect as your code might be, customers deserve a hint when major changes were done under the hood. Moving from 0.6 to 0.7 screams "just a few changes, some new features", not "we threw everything out and started over". This should have been made into "1.0beta", I would think.
Re: Why We Threw out All Our Code (And Why You Should Too)
#28Please bear in mind the counter article everyone is citing ( http://www.joelonsoftware.com/articles/fog0000000069.html ) was written 11 years ago. I'm not saying that it's wrong because it's from 11 years ago, but you really want to consider its central example. Netscape 6.0 was a complete rewrite. The article claims that this was a mistake. Now, if you would recall, one of the reasons Netscape 6.0 was completely rew…
This is one of the reasons you should write tests as you develop - it ensures you have a consistent baseline you can apply.
As a developer you are constantly learning & evolving. If you're not confident enough to draw a line under what you've done, step back and evaluate your position and rewrite it when needed - that's fine, but others find it an effective approach to building something bigger, better and more sustainable.
Re: Why We Threw out All Our Code (And Why You Should Too)
#29Throwing out all your code and rewriting it from scratch is like demolishing your building and constructing a replacement from scratch. It's usually not the right thing to do, it occasionally and rarely is the right thing to do, and it's always the tempting thing to do. It's stupid to argue, "You should never tear down a building" (like http://www.joelonsoftware.com/articles/fog0000000069.html implies) and it's also…
Your analogy fails, sir.
It's easier and more common to write dirty code that functions as it should than build a building with poor foundation but that looks and functions as it should.
Re: Why We Threw out All Our Code (And Why You Should Too)
#30Please bear in mind the counter article everyone is citing ( http://www.joelonsoftware.com/articles/fog0000000069.html ) was written 11 years ago. I'm not saying that it's wrong because it's from 11 years ago, but you really want to consider its central example. Netscape 6.0 was a complete rewrite. The article claims that this was a mistake. Now, if you would recall, one of the reasons Netscape 6.0 was completely rew…
As bad as Netscape 4/5 may have been, while I can't guarantee trying to refactor instead of rewrite would have gone better, I can guarantee it couldn't have had any worse a result than the Total Death that was the actual result.
And the phoenix-return of Mozilla is the exception, not the rule.