Legacy Code
Noun · Slang & Abbreviations
Definitions
Legacy Code refers to existing source code that is outdated, poorly understood, or difficult to modify, typically inherited from previous developers or earlier technology eras. Michael Feathers in Working Effectively with Legacy Code defined it simply as code without tests, because untested code is inherently risky to change. Legacy code accumulates technical debt through years of patches, workarounds, undocumented behavior, and shifting requirements. It often uses deprecated libraries, obsolete architectural patterns, or languages that current team members are unfamiliar with. Despite its difficulties, legacy code represents enormous value: it encodes years of bug fixes, edge case handling, and domain knowledge that would be expensive to recreate. Strategies for working with legacy code include characterization tests (tests that document current behavior before making changes), the strangler fig pattern (gradually replacing legacy components with new implementations), and incremental refactoring. The most dangerous approach is a full rewrite, which frequently fails because it underestimates the hidden complexity embedded in the existing system.
In plain English: Old code that nobody fully understands, written by people who've since left, that the current team is afraid to touch but can't replace.