Ask HN: Rewrite outsourced code or refactor it?
The app isn't super complex (yet) because they were waiting to add most of the complexity once they could get a proper dev team. The code is a mess though, here are some things:
- Inline SQL statements
- Inline PHP inside of on-page javascript
- Pages aren't even W3C validated (or even close!)
- No tests at all
- No data modeling whatsoever
- Tons of PHP related inconsistencies in the data int 0 is false - obviously.
- And much more!
Our choices are:
- Continue in PHP and try to refactor
- Switch to python with Django or something and do a full rewrite.
Underlying db is MySQL. Currently, I'm the only developer but we're looking for more. However, if we do decide to rewrite I'd look for the python variety - otherwise I'd go down the PHP road. (I'm comfortable in both, worked with both in production)
HN Gurus, what are your opinions on refactoring vs. rewriting such a code base ? Everywhere I look people say "Do not rewrite, you'll kill yourself" but almost every time the condition of the code doesn't seem quite like this.. at-least not in the way it's described.