28

Everyone talks about legacy code in software development and I have heard the term over the last ten years used to paint any codebase as being bad.

Where did this term, which has such powerful connotations to programmers alike originate?

I am sure there must be some book on software development that pioneered this term. I would love to locate the origin of the term "legacy code".

13
  • 14
    I heard the following definition of legacy code 20 years ago and I've remembered it ever since: legacy code is the code you currently have in production. It has helped my point of view many times. Commented Jun 9, 2014 at 16:08
  • 11
    "Legacy code" is a negative term? Who says that? Anyway, the word "legacy" is not specific to programming, nor is it especially significant in this context. Commented Jun 9, 2014 at 16:10
  • 5
    Michael Feathers (amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/…) is most probably not the inventor of that term, but he made an interesting definition: he called legacy code "code without tests". And that is indeed a negative attribute.
    – Doc Brown
    Commented Jun 9, 2014 at 16:56
  • 12
    Write a bunch of code. Check it in. Go get some lunch. Come on back. There's a whole screen full of legacy code! You've now got to understand that code and make sure that all future changes work correctly in the context of that code. Legacy code is the same as existing code. Commented Jun 9, 2014 at 18:35
  • 4
    "Legacy" here simply means that the original developers are not around any more, and only the code and documentations artefacts are left. It does not refer to an age or quality in any way.
    – SK-logic
    Commented Jun 9, 2014 at 20:43

4 Answers 4

39

Legacy code is based on the phrase of a legacy system that specifically applies to code. According to Wikipedia it probably dates back to the 1970s and was in common usage in the 1980s. It took off with the tech explosion of the 1990s.

This can be seen with Google's ngram viewer: legacy system,legacy code

legacy system and code

Digging into this further, you can find documented uses of the term 'legacy system' in the 1970s.

The earliest example of 'legacy system' that google has is in a book on Proceedings of the Army Numerical Analysis and Computers Conference from 1978:

... well strutted and documented solution to a clearly defined problem is the legacy system operation needs to be understood and to change the existing system with confidence.

There is also an example of 'legacy system' being used outside of the technology industry in Clout: Womanpower and Politics grin 1976:

... in addition, she holds a seat as the third-ranking Democrat on the powerful Banking and Currency Committee - positions of power she has built up on her own, not via the legacy system.

Beyond these example which shows its use has extended beyond the pure software world, the specifics of where exactly the term originated are probably lost to the sands of time. Given the military and political references, it may have originated with them (primarily the military and its jargon migration ("It seems likely that 'kluge' came to MIT via alumni of the many military electronics projects run in Cambridge during the war (many in MIT's venerable Building 20, which housed TMRC..."))

7
  • This is a great answer. I am going to keep researching to see if I can find an origin, but you are likely right that the origin has been lost or possibly not documented.
    – stevebot
    Commented Jun 9, 2014 at 16:31
  • 1
    @stevebot I'd suggest following the path of 'legacy system' rather than code... that term seems to have predated legacy code and has the same essential meaning.
    – user40980
    Commented Jun 9, 2014 at 16:42
  • 6
    The text in your 'book on carbon-carbon bond formation from 1979' is from a book called 'New practices in project management' and is from 2002 (first published 1998). It looks like something got confused in the scanning. Commented Jun 9, 2014 at 18:46
  • 1
    Doesn't seem like this is the source of the negative term.
    – JeffO
    Commented Jun 9, 2014 at 19:05
  • @JeffO No, as MichaelT mentions its not conclusive where it came from. This is a damn good answer though which shows research and effort.
    – stevebot
    Commented Jun 9, 2014 at 19:09
5

Legacy code base usually refers not to a POS system, but rather any system that exists in a code base or system that is no longer used for new development. For instance my team currently supports a few .net 1.1 and 2.0 applications that are considered legacy code. If there comes a time where a modification is required they will be either rewritten or updated to use the latest frameworks and standards. Until then we manage them as legacy applications that need to continue to function but no enhancements or code fixes are implemented.

There are also a few legacy systems that we do not support at all that were written in VB6 and Classic ASP. We have no capacity, or directive to support or modify these systems but as long as they continue to run and have no needs for enhancements they will not likely be updated. There is nothing particularly wrong with any of these systems. They perform their jobs the way they are supposed to and aside from looking like an app from the mid to late 90's they have no major issues.

So legacy does not mean POS just a system that was created in an earlier technology or language that is not up to current standards. Some legacy systems qualify as POS mostly because they lacked the development methodologies that exist to day that allow for managed code and the 15+ years of experience of the veteran web coders.

6
  • I completely agree that Legacy systems are not necessarily POS systems. I am wondering what the origin of the phrase is.
    – stevebot
    Commented Jun 9, 2014 at 19:49
  • 3
    @stevebot If you want to find the origin of the term, you should ask for that without presupposing a connotation.
    – user
    Commented Jun 9, 2014 at 21:16
  • 2
    @stevebot - A legacy is anything you leave behind when you pass on. I would presume that the descriptor was just adopted from that they way it had been adopted to countless other fields. Commented Jun 9, 2014 at 21:30
  • 1
    @MichaelKjörling are you telling me you have never heard legacy code used in a negative sense?? That isn't my connotation, but that of others I have heard time and time again in meetups, books and jobs.Like I said, I completely agree that legacy should not be a negative term.
    – stevebot
    Commented Jun 9, 2014 at 21:33
  • @stevebot - legacy code only seems 'negative', because it's only ever used in the context of replacing or interfacing with an older system (and the difficulties thereof). A program that was built over a decade ago but is still useful/relevant and has few bugs is still 'legacy software', but everyone just calls it 'software'. Same goes for codebases.
    – Robotnik
    Commented Jun 10, 2014 at 1:34
3

"Legacy code" is a term used by marketing people to pressure those whose code is old (but presumably works fine) into updating to the latest greatest (and probably more bug-ridden) software languages and techniques. It is closely linked to "legacy system", which refers to old hardware and operating systems that work fine but don't conform to what is now "politically correct" (e.g. OpenVMS, IBM system).

1
  • 6
    While this might be true, it would be better if you were to edit the answer to cite specific references supporting the claims made in this answer. Are there any such references that you can cite?
    – user
    Commented Jun 10, 2014 at 6:53
2

The term legacy code dates to at least 1989 as used by Glenn Everhart in comp.sys.amiga:

(...by the way, yes, I do sometimes program in C also...but I find it easier to convert legacy code w/o changing its language...)

I found nothing verifiably earlier in Google Books.

2
  • As Eric Lippert pointed out, the very minute after you wrote a piece of code you got legacy code. The curves shown by MichaelT and your finding just visualize the time frame, where the mainstream rise of IT started to produce immense amounts of code, involving lots of people all over the world. A bit later the need to replace "old" systems by newer ones raised too - and that's why and when it became a widespread term.
    – JensG
    Commented Jun 10, 2014 at 10:13
  • 1
    Old code was being replaced constantly, if there was a good reason to. I used to work on a mainframe billing system written (in PL/1) in 1970. It replaced a system written in mainframe assembly language (which in itself was largely an automation of an existing manual system). The PL/1 system was finally replaced after about 35 years of use (couple of failed attempts to replace it prior to that). Possibly now modern technologies are scrapped far earlier (and with disregard for how much rewriting of heritage system this is likely to entail).
    – Kickstart
    Commented Jun 10, 2014 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.