Ask News.YC: Should you rewrite your software from scratch?
The decision to rewrite software has hurt some companies. However, we only hear about the bad that's come from a software rewrite, never the good. So with today's new coding methods, do articles like this one still apply? http://www.joelonsoftware.com/articles/fog0000000069.html
Have any of you rewritten or made the decision to rewrite a large codebase? I know Kiko mentioned it as one of the things that hurt them. Microsoft was about to do it with their Pyramid Project, but it was axed.
Another question, for YC: Do YC companies generally rewrite their projects after Demo Day (since it's supposed to be a throwaway prototype), or work with what they've got?
8 comments
[ 6.2 ms ] story [ 26.3 ms ] threadThen decades later, on an entirely different product, in a different business...
We had to migrate our product to a new OS platform, as well as needing to fulfill much wider requirements for our customers. The existing code just wouldn't allow this, even if it were stretched and stretched.
So I rewrote most of the codebase.
In some ways I was tortured knowing we had a functioning product that already handled things I was rewriting (even though it was on an obsolete platform). Especially since the rewriting process takes longer than zero.
On the other hand, the new set of code turned out smaller, simpler, more reliable, much more flexible, and is now working well as a foundation our for business.
Both sides of the argument make sense to me, I think it just depends on the situation.
Throwing away something that's been tuned to target customers is a mistake. This is what Joel is talking about.
Most importantly, these are very, very different activities.
Except, of course, when time and money is ticking and they're not. Then you have to brave (which is what you call it when it works) or foolish (which is what you call it when it doesn't).
True enough, in university I quickly learned to get things right the first time - because I won't have time for a second try. It's a habit I've kept after I graduated.
I think the parallel to software is pretty obvious. It's easy to say "I'll rewrite this later", but when later rolls around, you have 3 other deadlines to meet. Throw-away code might still stay in the production code for 2 years. Refactoring parts of the code is good and necessary, but there are only so many resources you can dedicate to it.
I guess if you're seriously considering rewriting something from scratch, you're already caught between a rock and a hard place. Rewrite, and you miss an entire development cycle at least - time that could be spent enhancing or adding features. Stick with what you have, and you have to work with a codebase that makes development a nightmare (otherwise you wouldn't consider rewriting).
Better to avoid it if possible - do a bit of planning upfront, refactor when you can, have enough tests that refactoring is safe.
At my last job we rewrote a large part of the application - but it was done piecemeal, over two years, and never halted development or delayed new features. Refactoring was "snuck in" as part of deliverables whenever it was possible and safe. It was worth it because the new code performed up to 2 orders of magnitude better, and was much easier to work with - but we never would've been able to do it if we simply decided to drop everything and announce that we're rewriting the app from scratch.
I think if you don't have a good idea of what you're doing when you start, you might need to write a throwaway version first, see what works and what doesn't, then write the real app. I suspect in many cases, bottom-up design will reduce the need to rewrite by giving you more opportunities to refactor instead of throwing out the whole thing.