2 ms·
It sounds like you're referring to two different large Java projects, though. If you can port it by just stripping out the boilerplate -- if it's at heart just
by jtheory 16y ago
It sounds like you're referring to two different large Java projects, though. If you can port it by just stripping out the boilerplate -- if it's at heart just a CRUD UI with 7 frameworks and "enterprise best practices" mixed in -- then this is not the twisted and unmaintainable monster you're talking about afterwards. It's less fun, but I've worked on lots of sprawling & unwieldy Java apps implementing simple requirements, and it's not hard (it's also not easy to justify a rewrite, unfortunately). Bugfixes don't take weeks (or even days), particularly not once you know your way around a bit.
The app with the twisted logic (where bugs take weeks to fix, that has mutated over years and years of hacked-in change requests and quirky tweaks often for specific users' needs) is the one that screams for rewriting, but this is also the app where no-one knows exactly what it does anymore.
And if you don't know what it does, I have no idea how you could claim to know what it should do.
Many of the odd features are there for customers who aren't even customers anymore, but no one knows. Even the code doesn't always help much -- I've seen processing where it fails in the mid-method every time for some foolish reason (and logs an error then returns), but the code after the failure is actually direly broken and must never be executed.
I've tried (failed, actually) rewriting one of these as well as doing lots of refactoring on these kinds of projects.
With the first kind of app, you still understand it, so bugs can be fixed, new features are possible, and there's no clear case to rewrite it. With the second kind of app, you can either do what I mentioned above (and maybe you're talking about this, more than a rewrite?) -- start talking with/watching users, take a lot of notes, and build a new similar application all the way through, which will necessarily start off missing much of the functionality of the existing one.
Refactoring isn't about giving you time; it's about paying off technical debt and forcing the codebase back into a state where you can do progressively larger refactorings. This includes modularizing the existing app so that you can replace it piecemeal. New pieces do not need to operate within the old framework. It's quite possible (and sometimes desirable) to refactor the original codebase completely out of existence.