Ask HN: Rewrite or Refactor?
Thanks!
Thanks!
Rewrites from scratch are pretty much always a stupid idea, and so you and the rest of your team are both probably wrong. Rewriting, in .NET or "new" RoR, is probably a waste of resources, and will probably introduce a whole new slew of stupidities and problems. Citation: http://www.joelonsoftware.com/articles/fog0000000069.html
12k LOC is less than 6 months worth of work for one motivated developer, for a reasonably specified application (a working example implementation is a reasonable specification). If you're a team working on it...well, if it takes you longer than 6 months, you've got bigger problems than just the ugliness of your codebase or the lack of test coverage. Then again, both you and your team are amateur enough to think rewriting is a great idea, and you're just arguing over which technology to rewrite it in, so maybe you can't actually finish it in 6 months. Maybe the practice and experience of doing dumb things and learning from those mistakes will help you all become better developers.
Anyway, even if it only takes 6 months, do you really want to be six months behind your competitors?
No, this is not a rule of thumb. But an app already in production has a lot of little quirks already ironed out. That report one person really needs every third Friday of the month. When an Korean speaking costumer on a Spanish Windows Vista 64bits running Flash 7.0 reported a bug on Internet Explorer 6 with Norton blocking the referer.
Code has knowlegde. Use it.
If a single module can be ported to sane code successfully, you have a chance to fix the rest. If not, start reimplementing the whole thing in parallel. If you have no parallel test environment, create one first (so you can "deploy" your copy as if it were real).
It's all about the order in which you tinker with it. :)
This will inform either decision, and you'll look like you show a lot of initiative because you do.
A rewrite would take about 2 years probably (using some very naive calculations).
It may be slim on unit tests, but it passes one huge integration test (people are using it!). You can add unit tests as you refactor, and make gradual progress.
Rewriting from scratch you will need to relearn all of the knowledge that already has been put into that code, and it's an all-or-nothing bet.