Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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 a POS. 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".

share|improve this question
13  
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. –  Michael Durrant Jun 9 at 16:08
7  
"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. –  Robert Harvey Jun 9 at 16:10
3  
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 Jun 9 at 16:56
11  
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. –  Eric Lippert Jun 9 at 18:35
3  
"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 Jun 9 at 20:43
show 8 more comments

4 Answers 4

up vote 36 down vote accepted

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 code' that google has is in a book on carbon-carbon bond formation from 1979:

Wrappering - Creating a software wrapper to encapsulate and modularize legacy components enables them to coexist and communicate with object-oriented components. A function server lets the legacy code send and receive object-oriented messages. In this way, wrapping positions legacy code to provide containing value and to be reused in future systems.

Beyond this 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.

share|improve this answer
    
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 Jun 9 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. –  MichaelT Jun 9 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. –  Pete Kirkham Jun 9 at 18:46
1  
Doesn't seem like this is the source of the negative term. –  JeffO Jun 9 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 Jun 9 at 19:09
show 1 more comment

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.

share|improve this answer
    
I completely agree that Legacy systems are not necessarily POS systems. I am wondering what the origin of the phrase is. –  stevebot Jun 9 at 19:49
3  
@stevebot If you want to find the origin of the term, you should ask for that without presupposing a connotation. –  Michael Kjörling Jun 9 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. –  Chad Jun 9 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 Jun 9 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 Jun 10 at 1:34
show 1 more comment

"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).

share|improve this answer
5  
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? –  Michael Kjörling Jun 10 at 6:53
add comment

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.

share|improve this answer
    
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 Jun 10 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 Jun 10 at 10:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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