• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The meaning of "legacy"

 
Greenhorn
Posts: 11
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Over the years, I have seen the term "legacy" used with different shades of meaning:

  1. Code without tests, or at least without thorough test coverage.

  2. Code that runs on old platforms, or in old frameworks, that the organization desires to replace.

  3. A collection of systems without clearly-separated services and layers.

  4. Systems/services that the organization wants to expose in a different style (e.g. shift from method-oriented API to resource-oriented protocol).

  5. Old stuff that the speaker would rather rewrite from scratch than work hard to understand.

  6. ...and others...


In addition, calling a system "legacy" sometimes is perceived by those who developed (or who maintain) it as code language for "You people aren't good programmers."


So I'm wondering if you can unpack the sense(s) in which you use the term "legacy" and provide specific guidance for each shade of meaning, especially in terms of helping teams that worked on the "legacy" software become active participants in the re-engineering work.


Thanks!
 
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have heard legacy software described in pretty much every way that you have listed there.

However, my favourite is from Michael Feathers where he describes legacy code as code without tests. The interesting 'quirk' about this definition is that it says nothing about the age of the code. It could be code you wrote 5 minutes ago. Without tests, that code is immediately untrustworthy.
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joel Neely wrote:
Old stuff that the speaker would rather rewrite from scratch than work hard to understand.


To what Tim said, it doesn't even have to be old to be hard to understand. I go by Michael Feathers' definition of "legacy software", too.
 
Author
Posts: 18
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Trying to define 'legacy' always reminds me of US Supreme Court Justice Potter Stewart discussing the definition of obscene material:

I shall not today attempt further to define the kinds of material I understand to be embraced within that shorthand description, and perhaps I could never succeed in intelligibly doing so. But I know it when I see it



Here's my stab at a definition: Legacy code is any code whose existence hinders any work performed upon it.

We've all had that all-too-rare experience of working on excellent code. It's a joy to work with - it seems to positively invite that change that you want to implement, quietly guiding you towards the most elegant possible solution. The support framework is in place to allow you to add a test for your new code with a minimum of fuss, and the design gives you confidence that your change will not inadvertently affect the surrounding code. Working with this project reminds you why you chose to be a programmer in the first place!

Unfortunately 99% of code that I have worked with (written either by me or by someone else) doesn't have this mystical property of "excellence". Every time you want to make a change, you find that some piece of existing code gets in the way somehow. Either it's impossible to write a test, or you can write a test but you can't test your change the way you wanted to. Perhaps you find that there's already code that does something very similar to what you want to do, but it's just coupled enough to other components to make it impossible to re-use.

In other words, according to my definition above, the vast majority of code is legacy code, since it hinders you whenever you try to change it. And most of us are writing legacy code most of the time!
 
Junilu Lacar
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you have a winner of a definition there, Chris.

My gut check is if I feel guilty about leaving code the way it is. It's a very subjective measure, I know, and some are more jaded than others when it comes to empathizing with that unknown programmer who will inevitably suffer when they inherit the code. How much you empathize and do something about it is a measure of your professionalism, IMO.
 
Junilu Lacar
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This goes back to my comment in another topic about the documentary, "Jiro Dreams of Sushi", and the sense of social responsibility that shokunin have. As developers, we have a responsibility to ensure the quality of our work so that it brings more enjoyment and value than it does pain and suffering.

Edit: Section 1.2.1 of Chris' book actually mentions social responsibility. Seeing as Chris works in Japan, I wouldn't be surprised if the ideals of shokunin are behind that mention.
 
reply
    Bookmark Topic Watch Topic
  • New Topic