Jump to content

Legacy code

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Beland (talk | contribs) at 05:57, 5 September 2021 (partial rewrite). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Legacy code is older computer source code. It could simply refer to an organization's existing code base which has been written over many years, or it could imply a codebase that is in some respect obsolete or supporting something obsolete. Long-lived code is susceptible to software rot, where changes to the runtime environment, or surrounding software or hardware make require maintenance or emulation of some kind to keep working. Legacy code may be present to support legacy hardware, a separate legacy system, or a legacy customer using an old feature or software version.

While the term usually refers to source code, it can also apply to executable code that no longer runs on a later version of a system, or requires a compatibility layer to do so. An example would be a classic Macintosh application which will not run natively on Mac OS X, but runs inside the Classic environment, or a Win16 application running on Windows XP using the Windows on Windows feature in XP.

An example of legacy hardware are legacy ports like PS/2 and VGA ports, and CPUs with older, incompatible instruction sets. Examples in legacy software include legacy file formats like .swf for Adobe Shockwave or .123 for Lotus 1-2-3, and text files encoded with legacy character encodings like EBCDIC.

Perspectives on legacy code

Some in the software engineering prefer to describe "legacy code" without the connotation of being obsolete. Among the most prevalent neutral conceptions are source code inherited from someone else and source code inherited from an older version of the software. Eli Lopian, CEO of Typemock, has defined it as "code that developers are afraid to change".[1] Michael Feathers[2] introduced a definition of legacy code as code without tests, which reflects the perspective of legacy code being difficult to work with in part due to a lack of automated regression tests. He also defined characterization tests to start putting legacy code under test.

Ginny Hendry characterized creation of code as a challenge to current coders to create code that is "like other legacies in our lives—like the antiques, heirlooms, and stories that are cherished and lovingly passed down from one generation to the next. What if legacy code was something we took pride in?".[3]

  1. ^ Lopian, Eli (May 15, 2018). "Defining Legacy Code". Retrieved June 10, 2019.
  2. ^ Michael Feathers' Working Effectively with Legacy Code (ISBN 0-13-117705-2)
  3. ^ Ginny Hendry 'Take Pride in Your Legacy (Code)' (https://8thlight.com/blog/ginny-hendry/2014/07/11/take-pride-in-your-legacy-code.html)