In his post Things You Should Never Do, Part I, Joel Spolsky gave a warning: Never rewrite the code from scratch! The reason is that programmers are easy to think the old code is a mess, and that’s because of a fundamental law of programming: It’s harder to read code than to write it.

Old code is better than a new code because it has been tested and lots of bugs have been fixed. Rewriting them means that you lost this knowledge and effort. Besides, Rewriting the code from scratch normally wastes a lot of time, that’s a gift to your competitors.