Chapter 4. Rewriting (Transplants)

“I would rather make my name than inherit it.”

— William Makepeace Thackeray


4.1. Strategizing

Perhaps the most important question you will have to answer to begin with is this: To what extent should you rewrite the code? Even if at first it looks far too long to replace, rewriting from scratch is an option you should pursue if at all possible for a host of reasons:

• It allows you to psychologically “own” the code: It’s no longer someone else’s code; it’s yours, because you typed it.

• You’ll be far more familiar with the code, because people remember things much better if they’ve written them instead of merely ...

Get Perl Medic: Transforming Legacy Code now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.