We have a project that keeps recurring. The client expects us to run a website twice a year and this is happened for the last year and a half. I took the last working copy and based our latest website on it. Now, a co-worker has suggested that next time we should start from scratch instead of fighting against legacy code.
I have already started refactoring the existing code and so have the other developers who were on the project. The code is cleaner than before and it meets client needs. The refactoring was ongoing while we developed new features.
What are some good reasons to advise against starting from scratch?
2
Rewriting it from scratch will likely take more time than refactoring and working with legacy code, unless the legacy code is truly a disaster.
Instead, I recommend spending some extra time during the beginning of each project to refactor the code more, to let you work with it more easily. This is probably a more time-effective approach, and over time, your code quality will improve
There are a few reasons to rewrite from scratch. I already mentioned them in another answer. In short, the reasons to reinvent the wheel I mentioned are:
-
Because someone doesn’t know that the wheel exist already,
-
Because someone knows that the wheel exist, but doesn’t like it,
-
Because someone believes she can make a commercial scale product,
-
Because it’s fun.
In your case, none of those reasons seem to apply. The second reason might be valid if the code is really old and really bad (so bad it cannot be reasonably refactored), but from your answer, it seems it’s not the case.
Joel Spolsky, on the other hand, mentioned why throwing away existent codebase and starting from scratch is a really, really bad idea. This article alone should convince your coworker that his suggestion may not be the best.
0