• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is legacy code?

 
Abhishek Reddy
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any one tell me what is legacy code?
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Abhishek,


can any one tell me what is legacy code?


There has been version 1.1, 1.2, 1.3, 1.4 and 1.5 and now we have Java 6.
Change is part of nature. Still there may be several billion line of code (LOC), written following the Java 1.2, 1.3 versions and so on.
With Java 5.0 we have generics (type safe working), var-args, Autoboxing and so many strong API's. We have refinement, enhancements and what say?

The code which is written in precious versions are known as legacy code. Your work is running using that codes. We can't change them in a day; We have to very careful, and specially Java API designers and developers;
They have to think it several times whether what they are going to develop would break the existing code; Certainly they would not want to do so.

There is a lot of code which is created using newer version and has to be work with legacy code.


Regards,
cmbhatt
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the dictionary, legacy is "something transmitted by or received from an ancestor or predecessor or from the past."

"Legacy code" is often a code word for ugly old stuff written by some old hack that you wouldn't have written that way because you're much smarter but now you have to live with it. In reality that could mean anything you wrote yesterday. Many times a "legacy system" is something that you cannot modify, so you have to work around its quirks. In my shop "legacy" specifically means mainframe COBOL, probably written in the 1970s.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Stan James:
[QB]Many times a "legacy system" is something that you cannot modify, so you have to work around its quirks. In my shop "legacy" specifically means mainframe COBOL, probably written in the 1970s.


I like the definition Micheal Feather uses: legacy code is code that doesn't come with (unit) tests.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So code with good tests would never become legacy? An interesting notion.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In reality that could mean anything you wrote yesterday.

I agree with this definition (although more often the case would be "what someone else wrote yesterday" or "what I wrote 2 years ago"). It has very little to do with the JDK version that was used to develop it.

I think the definition by the presence of (unit) tests refers mainly to maintainability, which is a big part of it: if there are plenty of tests, the likelihood of the code being maintainable (and thus not feeling like legacy code) is greatly increased.
 
william gates
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is basically anything that was written yesterday. It really depends on what kind of projects and companies you work for.

I've worked on projects where legacy meant applications on a Tandem Mainframe system using TAL and later C. I've worked on other projects where legacy meant an old Unix mainframe system using Cobol and DB2.

But I've also worked on projects where EJB 2.0 was considered legacy and what was done six months ago was considered legacy. It really depends on what kind of company and projects you work on.

Many times legacy code means mainframe systems, but many times it could mean a project you did six months ago.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic