In a now famous article by Joel Spolsky, he argues that you should never rewrite projects from scratch. To be fair, I’ve done this, but generally on open-source projects where I’m donating my time. I’m less worried about financial constraints or competitive advantage.
Aside from that edge case, I generally agree with Joel Spolsky. If something is a tiny project, refactoring is often trivial and if you want to do a rewrite, so be it. However, large projects are often dangerous to rewrite. But how did they become large projects? The vast majority of “large” projects I have worked on started out as small projects which gradually had features and cruft added. Interestingly, this is very similar to how agile methodologies work: build something small, but useful, in the first iteration or two. Always have working code and keep building on it. So the rewrite seems like a good idea because we’ve already shown we can create the project, right?
Anyone familiar with the Mythical Man Month has an idea of how and why large projects are more likely to fail than small ones. When we have a rewrite that we’re concerned about, we tend to have a “large project” and thus we increase its chance of failure. However, we also have a lot of domain knowledge and if you have competent enough programmers with plenty of experience, is this domain knowledge sufficient to overcome the disadvantages of a rewrite? The larger the project, the more likely the answer is “no”. However, while I’ve seen plenty of studies regarding the success of projects and correlating their success with project size, I can’t recall seeing one correlating success with whether or not the project is a rewrite. Though this is informal, what’s been your experience? I don’t expect you to answer all of these questions, but I’m curious.
- What was the problem domain?
- Did the project succeed or fail?
- What success criteria were used to judge?
- What was the rationale for the rewrite?
- How many developers?
- What was the “size” of the project? (tough to quantify, I know)
- What was the expected versus actual timeframe?
- Was automated testing involved?
- Any other comments you care to offer?
Feel free to answer any or all of the questions above.