Rewriting from scratch
gocardless.com
gocardless.com
1. Re-writing code is the Innovator's Solution to the Innovator's Dilemma.[0]
2. Mozilla wouldn't exist today if the Netscape team didn't decide to rewrite their browser engine.[1]
3. Isn't Basecamp New a rewrite?[2]
[0]http://www.amazon.com/The-Innovators-Solution-Sustaining-Suc... [1]http://en.wikipedia.org/wiki/Mozilla#History [2]http://basecamp.com/new
Thoughts?
Contrast that with developers wanting to rewrite because of vague frustrations or poorly-defined technical debt. Without a strict definition of the problem, a rewrite is doomed to repeat the same shortcoming as the original.
I've seen the most success happen on teams which can figure out how to rewrite the app one module at a time, while keeping the existing parts functional. This reduces the risk, and allows you to compare the new effort against old code more directly.
2. Mozilla wouldn't exist today if the Netscape team didn't destroy their company by deciding to rewrite their browser engine, no.
Whether we'd be worse or better off is an open question - a living commercial netscape could have kept the browser wars and associated innovation alive longer. On the opensource side maybe the better-architectured KHTML would have gathered more mindshare and funding and evolved into something like today's WebKit faster without the distraction of gecko.
I can assure you they are not meaningless buzzwords. I'd recommend reading the book before commenting since your reply adds nothing to the discussion.
> 2. Mozilla wouldn't exist today if the Netscape team didn't destroy their company
Any source to back up the claim that the Netscape team maliciously destroyed the company? What would be their motive? From everything I've read the codebase was an absolute mess, hence the motivation for a re-write.
Perhaps naively, I assume you hadn't realised you were talking in what sounded like meaningless buzzwords.
> Any source to back up the claim that the Netscape team maliciously destroyed the company?
I never claimed malice. I'm sure the decision to rewrite the code was made with the best of intentions. It still destroyed the company.
Really, though, I agree. Is the fact that the chose to rewrite their (failing) browser engine the reason that the company failed? Sounds more like an attempt to plug the hole in the company.
Also, the standard and IMHO valid riposte to the Mozilla rewrite is to observe that while it may all have turned out alright for the public in the end, Netscape didn't survive it. If you are in a business context, Netscape is still a warning about failure, not an example of success!
1. http://www.joelonsoftware.com/articles/fog0000000069.html
2. A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over, beginning with a working simple system. http://en.wikipedia.org/wiki/Systemantics#Elementary_Systems...
> "technical system"
I could have said software, but software can't be very complex or very simple. I probably should have said "complex software" instead.
Most rewrites are undertaken too lightly and with too much naivete. They are approached as projects with a lot of major unspoken assumptions. Often assumptions that are counter-factual. Assumptions such as: at code complete we will have a system that is as refined and defect free as a well-worn system that has been in real-world use for years. Or, there will be no problem with forcing every user to use the new system because it will be in every way objectively superior to the old system starting on day 1. Or, taking on the work of a rewrite won't cause a serious shortage of manpower needed to maintain the old system (or vice versa, the rewrite won't face a serious shortage due to the needs of maintaining the old system). And so on.
Yet such obvious fallacies remain as latent assumptions behind the majority of rewrites.
There are different ways to do rewrites effectively and none of them are easy.
One way is to build a parallel product using an entirely separate team, and having that product compete against your older product directly in the marketplace. This is obviously an expensive route, which is why a lot of companies shy away from it, but sometimes it's the best way to go about things. It gives a chance for a product to mature before it replaces the original. Microsoft did this with Windows, having two parallel teams work on different kernels (NT and 9x) and it took over half a decade for the "rewrite" to win out. This is even more astounding when you consider that originally Microsoft had intended for Windows 95 to be simply Windows 4.0 based on the NT kernel. A goal they didn't really achieve until Windows XP was released 6 years later.
An alternate way to do a rewrite is through refactoring style techniques. Start building the new system inside the old and slowly deprecate and migrate components piece by piece until the old system is entirely gone. This is a very effective way of doing things and has the advantage of being able to scale relative to the amount of development effort available but certainly has its fair share of limitations and downsides (which I won't enumerate).
As far as the Netscape example, they ended up coding themselves into annihilation, as their constant rewrites and architectural buffoonery led them to create a very unstable and clunky browser that was markedly inferior to IE 4 when it hit the market, and they just were not able to respond with any degree of innovation software wise. Also, my understanding is that the seed code for the mozilla project was a horrendous mess that didn't even represent a functional browser at the time and required extensive effort to get to that point.
They should have released the source of Netscape 3. In fact, even now I'd like to see the source of Netscape 3. It's nearly 20 years old but still a classic.
For those who haven't read this one I think it's pretty good: http://programmers.stackexchange.com/questions/6268/when-is-...
A rewrite is risk, a huge amount of risk. And often taking on risk can be bad, but often taking on risk is married to the possibility of huge wins. It takes good judgment and solid development practices to take on risky projects and persevere, but it can be done, and indeed is done all the time. Going into a rewrite nonchalantly with a thousand casually made false assumptions and all the while squeezing your dev. and QA cycles between two products is a very, very common way to waste a lot of effort and seriously hurt your company, especially in the market. So be aware of what you're taking on when you take on a rewrite.
As a general rule if your team/company is capable of taking on and succeeding at tasks that others typically struggle at then that can be a key competitive advantage.
> For a fundamental change in UI that lack of iteration wasn't acceptable. Starting from scratch with an early beta let us to collect feedback on the new interface immediately. Our speed of iteration was also increased as we didn't have to worry about breaking an existing interface.
I would have said "I've created an unmaintainable mess.", but from now on, I'll be using your nice euphemisms. "Local maximum" ... yeah, sounds proactive and empowering. I'll have to work on delivering it with a straight face, though.
You can see all kind of "rewrites" some with more luck, and others with worse. This one seems successful (I talk without numbers).
I've a personal pet project I'm always rewriting (from scratch). But, it's the single project in my life I can't validate the result, I've try many approaches. There is a few corner cases, were the only exit is to use unclean workarounds by language limitation... and even after a few renames and even language evolution, I think I'll retire "still rewriting from scratch" if I feel it can be better, and I've the freedom/budget/time to do it.
This can be either a pattern or an antipattern, depending on your perspective. I tend to think of it as an antipattern. Rewrites are often driven by difficulty in refactoring more than fundamental flaws, but the refactoring problems are caused by coupling between layers/systems.
The problem with rewriting to avoid a refactoring is that you're most likely going to wind up with a shiny new Ball of Mud.
You needed to add functionality but you could have left the old working functionality.
Another case for a re-right is when the project uses old technology that is hard to maintain with the people you have.
Re-writing the system in a framework that your team understands will take less time than trying to understand another framework.