Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rewriting because it is messy will almost never work. Rewriting because there is a fundamental problem with the code base may be worth it.

Problems can include:

- lack of parallelism, designed with single core CPUs in mind

- lack of security, software was designed for single user, offline operation turned multi-user and online

- "wrong" optimizations, for example relying on a lot of precomputation when people now want to change everything on the fly and modern computers allow it if the software is properly designed

- relying on outdated tech, like Flash

None of the previous points involve bad design, but things change, including user expectations. For now, security is a big one. It wasn't a big deal back then, for example, in a game console, a buffer overflow in a game would just cause a crash and piss off the player in some extremely rare case. Now because your console is online and so is your bank, the same relatively harmless bug on the same game can be used to siphon your bank account.



If the code is reasonable well designed (low coupling, separation of concerns and so on) then architectural changes can be introduced by refactoring. I can't imagine an architectural change which will require every single line of code to be rewritten in a realistic application. Most likely there will be large chunks of complex business logic which is largely unaffected by the architectural change.

But migrating away from an obsolete platform probably do requires a massive rewrite. Even then it might be possible to port (rather than rewrite) large chunks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: