*
The moose likes Beginning Java and the fly likes what is legacy code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is legacy code?" Watch "what is legacy code?" New topic
Author

what is legacy code?

Abhishek Reddy
Ranch Hand

Joined: Mar 28, 2006
Posts: 259
can any one tell me what is legacy code?


Abhishek
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
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


cmbhatt
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
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.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
So code with good tests would never become legacy? An interesting notion.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41630
    
  55
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.


Ping & DNS - my free Android networking tools app
william gates
Ranch Hand

Joined: Feb 21, 2007
Posts: 112
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is legacy code?