All topics / Reading Legacy Code

Reading Legacy Code

How to make sense of an unfamiliar, undocumented codebase without reading it top to bottom — and how to tell when it actually needs a rewrite.

Download EPUB
  1. Where to Start When You Don't Understand Any of It Don't read a legacy codebase top to bottom. Pick one real entry point and follow it through, end to end.
  2. Techniques for Making the Unknown Known Use git blame as archaeology, write a safety-net test before changing anything, and use small refactors to build understanding by doing.
  3. When (and When Not) to Rewrite Why the urge to rewrite legacy code is usually wrong, how Chesterton's Fence keeps you from removing something load-bearing, and the rare cases a rewrite is the right call.