Rewrite the code from scratch

The single worst strategic mistake that any software company can make:
They decided to rewrite the code from scratch.

Programmers always want to throw away the code and start over. The reason is that they think the old code is a mess. And here is the interesting observation: they are probably wrong. The reason that they think the old code is a mess is because of a cardinal, fundamental law of programming:
It’s harder to read code than to write it.

There are three kinds of things that are wrong with it.
First, there are architectural problems. The code is not factored correctly. The networking code is popping up its own dialog boxes from the middle of nowhere; this should have been handled in the UI code. These problems can be solved, one at a time, by carefully moving code, refactoring, changing interfaces. They can be done by one programmer working carefully and checking in his changes all at once, so that nobody else is disrupted.

A second reason programmers think that their code is a mess is that it is inefficient. But this only affects a small part of the project, which you can optimize or even rewrite. You don’t have to rewrite the whole thing. When optimizing for speed, 1% of the work gets you 99% of the bang.

Third, the code may be doggone ugly. Frankly, this is the kind of thing you solve in five minutes with a macros, not by starting from scratch.

Check ExpertWave refactoring course for more info

Bookmark the permalink.

Comments are closed