Legacy code

Legacy code is source code that relates to a no-longer supported or manufactured operating system or other computer technology. The term can also mean code inserted into modern software for the purpose of maintaining an older or previously supported feature  for example supporting a serial interface even though many modern systems do not have a serial port. It may also be in the form of supporting older file formats that may have been encoding in non-ASCII characters, such as EBCDIC.

In practice, most source code has some dependency on the platform for which it is designed  even if a programmer uses a platform-independent programming language like Java, it is hard to write a large, useful program that is totally independent of its environment. When the manufacturer upgrades a platform (or the platform is superseded), the code may no longer work without changes, and becomes legacy code. A large part of the task of a software engineer is to continually alter code to prevent this.

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.

Modern interpretations

More recently, the software engineering community has developed other interpretations for the term legacy code. Among the most prevalent 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]

gollark: It is of course not exactly very easy to know if there *is* no other way.
gollark: Regardless of actual evidence or truth.
gollark: I mean, you could argue that if you feel *extremely* unhappy if you don't believe in an afterlife, and there is no way to deal with this apart from believing in an afterlife, it's rational to believe in it.
gollark: I *have* been known to use reddit.
gollark: The probability of the Earth suddenly immediately being transmuted into pure bees is technically "nonzero" according to my very approximate understanding of physics.

See also

References

  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)


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.