4 ms·
Holy lord is that a lot of risk to accumulate doing a full rewrite and deploying it all at once. I think the hardest part about rewriting an app is knowing abo
by wikyd 15y ago
Holy lord is that a lot of risk to accumulate doing a full rewrite and deploying it all at once. I think the hardest part about rewriting an app is knowing about all the edge cases, kludges, etc. that accumulate over the years. It makes sense that the person who knows the most about the product and its dirty secrets would be much more capable of rewriting the app quickly than a newly hired employee.
As a counterpoint, last year I joined a startup as the first technical member. I migrated a PHP application written by an inept contractor (terrible DB layout, SQL queries in the views, most features buggy and incomplete, etc.) to Rails piece-meal. I had very little experience with Rails or PHP prior to this, but was able to rewrite the app in the course of a few months, while adding new features and continuing product development. I simply placed nginx in front of both the PHP and Rails app servers and rewrote the auth system for both apps so that cookies/credentials could be shared. Then it was a matter of migrating sections of the app over one-by-one. There was some hairiness in how the Rails side linked to non-Rails pages, but that code was gradually replaced as the rewrite progressed.
Even despite the abominable DB schema from the original PHP app (which, in fairness, had nothing to do with PHP), Rails was flexible enough to allow me to override its conventions and map tables to models with joins, etc. Overall, it was much simpler than I thought it would be and after the rewrite was complete, it was pretty simple to write migrations to start organizing the DB schema into something coherent.