Live data from Hacker News

The little legacy code that could: a fable of software ownership

circleci.com

41–50 of 76 posts

Re: The little legacy code that could: a fable of software ownership

#41

Earlier quoted context omitted.

> Legacy means it might be working, depending on your CURRENT needs. Your current needs change, even when the code does not. No working should mean "It fulfills the requirements". If the requirements change then the code should change. The other things you have mentioned are important but they aren't necessarily requirements e.g. Uptime / Reliability / Performance might be requirements but without stating what they s…

> If the requirements change then the code should change. That's the nature of the term "Legacy", that you are using. It met requirements that are not the same today (sometimes it's just standards of coding). It didn't change, hence it's legacy code.

There is all sorts of wrong here. You are conflating several concepts.

Firstly I was commenting on your very strange definition of what working meant. What we (programmers) normally mean by working we mean "It fulfills the requirement that it was developed against". If the requirements change, the code must change to reflect the changes in requirements. If the software is changed it is a different version of that software.

Legacy has nothing to do with that. Legacy until relatively recently meant "Not supported" i.e. Windows XP is "Legacy" whereas Windows 7 is not.

Consider the scenario:

I am asked to write a program to play sound. So lets make up some trite requirements.

* It be able to play .wav files

* Sound should always come out of the default audio device as designated by the OS.

It is written and released. We will call it version 1.0.0 and it is supported to December 2021.

People ask for more features. These new features are:

* It is able to play .mp3 files

* The ability to choose the audio device that you can play sound through.

It is written and released and it is called version 1.1.0 and it is supported to December 2022.

Now the requirements have changed however because we are still in the year 2019 they are both still supported. However the requirements to the software has changed and thus there is a new version of the software to reflect the change in requirements. That should be related in the change-log (remember those things).

In 2022 version 1.0 will no longer supported. There will be no defect fixes to it, but it still works i.e. fulfills the original requirements as listed above. However under the more traditional definition of Legacy Software it is considered legacy.

Things like code quality, maintainability etc. are separate issues.

Re: The little legacy code that could: a fable of software ownership

#42

"Why is there unclear ownership?" Because Extreme Programming (and other agile practices?) make Shared Code-Ownership a "value".

Well, I think the article not so great on this one. There is unclear ownership because management thinks that software is finished at some point. They think in terms of large, vague blocks of functionality and have difficulty understanding things at a finer scale. When requests come in from users of the software, they are often ignored by management because none of the requests are large enough to fit into their large, vague ideas. However, all the requests put together add up to a very large impact. The result is that the legacy code gets neglected and new greenfield projects get the attention. Because nobody works with the legacy code, it becomes strange and foreign. It is built with older technology which is no longer sexy and is boring on your CV, so the movers and shakers in the IT group tend to avoid it. It's not code ownership that's a problem -- the whole company washes their hands of it.

In terms of code ownership, you can run your group in a number of different ways. I've seen projects with code ownership work and I've seen projects without code ownership work. I vastly prefer the latter, personally. As long as you are churning the code regularly, a lack of code ownership means that internal conflicts about how things should be designed are forced out in the open. They don't fester for years and years, where groups of developers end up saying, "I can't work with that person. They are crazy." You have the conflict early when it doesn't have such a large impact and you sort it out early (Note: some people are just inflexible -- if you find that kind of person, knowing about it early is also good. You can deal with it).

When you avoid code ownership, you are also forced to have code that is clear for your entire group. For example, if you have a single person and they work in isolation, their code may be impenetrable to the others. But if each person in the group has to work on the code, code that most people don't understand has very little chance of surviving. Overall, I find that staying away from code ownership results in considerably more maintainable code.

However, there are clearly advantages to code ownership as well. One shouldn't snub their nose at the benefit of being able to see a piece of code and say, "I wrote that". Having ownership makes it easier to have pride in your work. It can be a very motivating factor. If you have people on your team who are feeling disconnected and don't feel like they are personally making an impact on the group, giving them a little piece of code to own can be very good for them.

Similarly, sometimes you don't have a choice for your team. Sometimes you have a team of people who just don't work well with each other and there is nothing you can do about it. Partitioning the code and allowing these people to keep their distance may be the only thing you can do. Ideals are great and if you can achieve them, it's wonderful. But you have to be conscious of reality. People are people.

I could go on and on, but I guess my point is that very often I see remarks like the one you made that seem to take a very superficial view of things. There seems to be no effort made to understand why other people have a differing viewpoint. Of course, you also get fan-boi style postings of, "The-new-hotness is the best thing because reasons" which are also unfortunate. Usually the truth is somewhere in between.

Re: The little legacy code that could: a fable of software ownership

#43
post #2

This made me think of an enterprise-software version of Wreck-it Ralph . I'd watch that, but I'd be part of a small audience (though arguably, Tron qualifies).

I'd watch a movie based on The Phoenix Project book.

I wonder if someone has optioned The Phoenix Project?

Re: The little legacy code that could: a fable of software ownership

#44

This is one of those interesting paradoxes that I haven't figured out yet. Owning the legacy software that runs the business tends to provide job security at your current job, but can hinder your professional growth at both your current job as well as any future jobs. Getting on to projects that are intended to replace legacy software tends to get you a lot of positive visibility politically and the ability to learn…

Yeah. Stated another way, building new stuff is more highly valued than maintenance. Even though the new stuff may fail, or the maintenance may end up requiring more skill than building.

This is what our industry values; make your choices accordingly. It’s also one reason for the perception that developers are more obsessed with new shiny things than learning their older counterparts. We’re incentivized to act that way.

You can’t only look at your work in terms of what is most valuable for the business, because that may turn out to conflict with what is best for you and your career.

Re: The little legacy code that could: a fable of software ownership

#45
post #14

I am currently rewriting a 10 year old VB application, which is in web forms. That application communicates with AS400 DB2 database. I get to use as400 here and there. My application is in .NET Core 2. There are some issues as anything IBM can be a pain in the ass to work with. Also, the as400 dev and me have a tremendous knowledge gap. I know everything new such as unit testing, proper source control, dependency inj…

Having been someone who's had to "setup" the db, app, etc. before ORMs were mainstream, you're wildly overestimating how complicated it was. It doesn't actually take very long, you'd maybe save a couple of days or so on a month project, having to write a a CREATE TABLE and then the corresponding class are actually trivial. You make the design decisions when you write the create statement, the class is simply a copy of it.

It's just a bit easier, not a lot. I certainly use ORMs now, but it's a convenience rather than a revolution. The truly revolutionary thing for code from that era of C# were lambda expressions.

In all honesty, he's an idiot for not updating his skills. If he simply learnt a bit of modern EF and learnt how to use git, he'd run rings around you. I'd note that "proper" source control practice has been around for well over a decade now (SVN was adequate, just not great for distributed teams), so he must be really adverse to change.

The unit testing and DI, on the other hand, is all pretty useless noise in a statically typed language like C#, for all MS push it. The only benefit in DI is keeping the same instance of the EF around, and it's pretty hard to actually get that working properly through-out the entire stack when you want to do anything even remotely creative.

As for unit testing, never seen the benefit. I took over a project with something like 50% unit test coverage that I never bothered to keep up, in 3 years the existing tests caught 1 bug.

All that highlighted to me that it was an utter waste of time and money it was writing all those tests.

Re: The little legacy code that could: a fable of software ownership

#46

Earlier quoted context omitted.

> Unfortunately there's just not a lot of value to being able to put on your resume that you're an expert at an older language that nobody has heard of, built on an in-house framework that will never be used outside of your current company. I think this is, fortunately, only approximately true. Most of my career to-date has involved exactly this kind of work and it's certainly not true that there's no value in it, ev…

Most of my career has been working on legacy projects (or fixing broken ones), I like greenfield well enough but I’ve no preference for it over maintenance. There is as much pleasure in making something broken work properly as creating the thing (imo). It’s a steady career as well, most programming is maintenance outside of the fail fast world of startups.

Even at my current job in a startup, 90% of the code I own can be considered legacy.

The startup is 7 yo, I joined almost 2 years ago.

The gap between old and new features is enormous .. and it will take years to reach some cohesion.

Re: The little legacy code that could: a fable of software ownership

#47

This is one of those interesting paradoxes that I haven't figured out yet. Owning the legacy software that runs the business tends to provide job security at your current job, but can hinder your professional growth at both your current job as well as any future jobs. Getting on to projects that are intended to replace legacy software tends to get you a lot of positive visibility politically and the ability to learn…

one skill I've learned working on/deprecating and replacing legacy code is what I'd call Code Archaeology: the practice of identifying what a legacy system does given some edge case; why it does it; whether that's the right thing to do, given that the ecosystem has changed significantly; and whether that section can be safely turned off.

I haven't seen the results of putting that on a resume yet though.

Re: The little legacy code that could: a fable of software ownership

#48

>The initial development cost of software rounds to zero when compared to operating costs in perpetuity. Mostly a good article, but what is with this quote? Aside from being factually wrong from a dollars and sense standpoint, doesn't it contradict their point that legacy code doesn't get enough love?

I don't think it contradicts the point.

When you have a legacy system that "sits in the corner" earning money, you're [the company] paying engineers to retain their services in emergencies. Features get added too, if you're interested in keeping or gaining customers. So construction cost as a proportion of total cost does trend to zero.

The company/stockholders doesn't care about hot new technologies. They care about revenue. Customers don't care their software is written in this or that framework or is powered by deep learning. They care about stable, usable, useful apps. Businesspeople know this. Many engineers do not. I think that disconnect causes much strife in tech businesses.

Re: The little legacy code that could: a fable of software ownership

#49
post #14

I am currently rewriting a 10 year old VB application, which is in web forms. That application communicates with AS400 DB2 database. I get to use as400 here and there. My application is in .NET Core 2. There are some issues as anything IBM can be a pain in the ass to work with. Also, the as400 dev and me have a tremendous knowledge gap. I know everything new such as unit testing, proper source control, dependency inj…

Having been someone who's had to "setup" the db, app, etc. before ORMs were mainstream, you're wildly overestimating how complicated it was. It doesn't actually take very long, you'd maybe save a couple of days or so on a month project, having to write a a CREATE TABLE and then the corresponding class are actually trivial. You make the design decisions when you write the create statement, the class is simply a copy o…

A decade of source control is an understatement. If you weren’t using it in the 2000s you were woefully behind. In the 90s it was exotic and terrible though. Even Microsoft had a horrendous system called SLM (or slime for short).

Re: The little legacy code that could: a fable of software ownership

#50
I think one of the reasons why it's such a conundrum is because software development as a practice is just now getting to the level of complexity where large groups of people have collaborated over a large codebase over a long time.

One of the problems that the microservice architecture is trying to solve is by making a a large software entity a collection of smaller easier to manage entities. It's like single cell organisms evolving to multicell organisms...each cell becomes smaller and simpler and more specialized and replacement of cells becomes easier and allows the overall lifeform to "scale" and become more complex.

Mature software companies have gone through this transformation multiple times already in the form of, n-tier, SOA, microservices, and now serverless architectures. This is all part of a natural progression of making individual components simpler, the overall structure more granular, and as a result more resilient. This resiliency opens up new capabilities to scale a complex system.

My long winded point being that legacy software will always exist yes, but each piece of legacy software is already getting smaller and more granular where rewriting it will eventually be a more continuous operation of refactoring small things--kind of like skin cells falling off your body or hair falling out.

Post reply on HN