Chapter 2: The Best Laid Plans
Mull It Over
Should you alter the layout of legacy code to conform to your latest code style? Is this a valuable use of code reformatting tools?
It’s usually safest to leave legacy code however you find it, even if it’s ugly and hard to work with. I’d only entertain reformatting if I was absolutely sure that none of the original authors would ever need to return.
By reformatting, you lose the ability to easily compare a particular revision of the source with a previous one—you’ll be thrown by many, many formatting changes which may hide the one important difference you really need to see. You also risk introducing program errors in the reformatting.
As far as code reformatting tools go, they’re nice curiosities, but ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access