You know, we didn't expect blah and blah. How could we have been so stupid?
But now we do understand the problem, we'll get it right. So, if we can just take some time out to redesign, rewrite from scratch ...
- JoelSpolsky on not re-writing : http://www.joelonsoftware.com/articles/fog0000000069.html
- some reasons not to re-write from PHP into RubyOnRails : http://www.oreillynet.com/ruby/blog/2007/09/7reasonsiswitchedbacktop_1.html
- ChadFowler series : http://www.chadfowler.com/2006/12/27/the-big-rewrite
Part of his advice on PlatformWarsLogic
and links to IncrementalistsVsCompletionists
Sometimes I throw away : http://sdi.thoughtstorms.info/?p=372
Joel : Don't rewrite code from scratch
Jane : But maybe you need occasional forest fires which destroy / rewrite one module of your code from scratch.
Joel (sceptically ironic) : Are YellowWolves caged in by modules?
Joel : Clever, but not convincing. Seriously, I'd accept you can scorch the undergrowth. How large a patch of earth would you scorch?
Jane : It's statistical, innit? Probably a PowerLaw, there should be a few large scale rewrites and more smaller ones. After all, you say that rewrites always fail, but there are plenty of new upstart companies with clean new code-bases that spring up to topple larger incumbents who glued up in a BigBallOfMud.
Joel : I wonder if that's just a special case of a model I was reading about recently by RobertAxtell on FirmSizes. Just as Axtell's sim-companies are brought down by a build up of unproductive parasites perhaps big code-bases are brought down by metastasized dependencies.
Jane : They freeze-up. Like IvanIllich's out of control professionalized bureaucracies.
Joel : Yes, but I've yet to be convinced that simply hitting them with some power-distribution of dramatic rewrites is more of the answer than any other kind of ReFactoring.
Jane : Maybe if we see our ball of mud as a ScaleFree network of malign dependencies. In other words a few super-nodes are often responsible for a lot of connectivity. Directed attacks at such SystemPunkts is usually quite effective against this kind of network.
Joel : Then it's all about traditional profiling and analysis
Jane : did I say it wasn't?
Joel hit dogmatism big time in his essay there. Another way to argument against it would be: OK - so you have a spreadsheet and you want a web server - would you just refactor the spreadsheet? The moral here is that it all depends on how far is your target from your current code. I do agree with Joel that programmers are eager to overestimate this distance - but there is some distance that justifies a full rewrite. – ZbigniewLukasiak