frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: What does "legacy code" mean to you?

4•Arperb•6h ago
I'm doing some research on how teams think about older codebases, and I'd love everyone's take on this. No wrong answers, just trying to understand how different teams or organizations define this.

Thank you in advance!

Comments

rossdavidh•5h ago
Having worked on code that was anywhere from 1 to 30 years old, in my experience "legacy" mostly means, "we wouldn't do it this way now, but it's not an easy thing to fix so we're either stuck with it, or stuck with it for a while anyway".

"Legacy" means "don't blame me, I'm not saying it should be this way, just that is is this way".

Which is interesting because outside of code, the word "legacy" is usually positive.

Jeremy1026•5h ago
For me it's code that's no longer being maintained, but you absolutely do not touch it because it's the glue keeping everything together somehow.
bdangubic•5h ago
“legacy” means that tens if not hundreds of people made something absolutely ridiculously amazing that has stand the test of time and probably made lives better for millions of people (depending on how large the customer base is)
nrhrjrjrjtntbt•4h ago
To me it is a purjorarive that means code that you need to replace or remove as tech debt.
journal•4h ago
Whatever no one is doing anymore.
sloaken•2h ago
To me 'Legacy code' means the person who wrote it (or most of it) is not fixing / changing it.

It implies you cannot ask them WTF is this. Or more critically Why did you do this? Which of course is critical to avoid the 'Chesterton's Fence' Which I learned about here on HN and find it such a critical aspect of documentation now.

fud101•2h ago
The other side of this is if they are still there but resistant to change or rewriting it in a better way.
shoo•2h ago
Michael Feathers, author of the book "Working Effectively with Legacy Code", [f] defined legacy code as code without automated tests.

From memory, the argument is that once you have automated regression/characterisation tests with sufficient coverage around the part of it you need to change, you're in a good position to attempt to make a change since you will be alerted if you are unintentionally introducing regressions. Without automated tests you can't efficiently and confidently make changes without significant risk of regressions. Feathers' book discusses testing and refactoring techniques to take OOP-ish application code that has no automated tests and get enough tests in place to let you change what needs to be changed in a controlled way.

A consequence of Feathers' definition of legacy code is that fresh code you wrote yesterday in a trendy programming language still gets classified as legacy code if you didn't also write the supporting test suite to help others maintain it in future! It's not a perfect definition, some might find it provocative, but it's both pragmatic and actionable.

A different take on legacy code could be something like Peter Naur's paper 'Programming as Theory Building' [n]. I don't believe Naur specifically discussed legacy code, but the rough idea is that each program has a corresponding theory (relating to the problem domain, organisational constraints, the implemented solution and its structure, alternative solutions that were considered and rejected, etc). Some of this theory can be written down in artefacts such as design docs, requirements or comments in the code, but for a software project to be alive, the theory needs to live inside the heads of enough of the team who are building and maintaining the software. If that is lost (e.g. the team departs and a fresh team is hired to replace them) then no one in the new team may understand the "theory" so the software project is effectively dead until the new team learns the problem and solution space and develops their own new theory.

I'd regard such a "dead" software project where none of the current maintainers understand the theory behind the existing code as being legacy code -- but this is a joint property of the people working on the codebase and the artefacts (source code, design docs etc), it isn't a property of the code base in isolation. Maybe "legacy code" is the wrong way of framing it as it misses the importance of the relationship between the maintainers, the codebase and the surrounding context, and something like "dead project" is a little more helpful.

[f] https://www.oreilly.com/library/view/working-effectively-wit... [n] https://pages.cs.wisc.edu/~remzi/Naur.pdf

pjacotg•21m ago
I was going to mention Peter Naurs paper as well. It's fundamentally changed the way I think about software. The projects I've seen that are in the most trouble are those where the current devs haven't had the opportunity to work closely with developers that understood the codebase well.
6thbit•2h ago
anything running in production is already legacy.

If you don’t design and write code with that in mind you’re basically planting landmines for your future self.

Interfaces are the only stable ground.

al_borland•1h ago
No one has maintained it in a while, and if a change is needed, it seems like a full re-write would be the better option.

Or the whole company has moved onto something new, and you’re maintaining the code to keep the legacy systems going until everything has migrated off it… so it needs to run, but no one really cares.

Facebook has made it impossible to delete Pages – dark patterns everywhere

28•ramharts•10h ago•9 comments

Ask HN: What does "legacy code" mean to you?

4•Arperb•6h ago•11 comments

Ask HN: Am I the only one thinking ChatGPT 5.1 Thiking thinks for too long ?

4•davidguetta•7h ago•1 comments

Meta-algorithmic judicial reasoning engine

2•YuriKozlov•8h ago•0 comments

Semantic Query Engines with Matthew Russo (MIT)

3•CShorten•14h ago•0 comments

Ask HN: Why does Y Combinator seem to be consistently funding AI slop?

13•coldtrait•13h ago•5 comments

ZkOrigoPlus – Compliance Validator Bridging Bank and Blockchain via ISO20022

2•ADCXLAB•15h ago•0 comments

Ask HN: Reason for the DDoS attacks on DALnet circa 2002?

7•Meekro•15h ago•0 comments

Cloudflare is working again for my servers (US East)

3•potatowaffle•15h ago•1 comments

Ask HN: Cloud providers are losing in favor of bare-metal?

34•clostao•2d ago•24 comments

Ask HN: Why All the Indonesian Spam?

22•al2o3cr•1d ago•7 comments

An exposed .git folder let us dox a phishing campaign

64•spirovskib•2d ago•21 comments

Built a Pomodoro timer for ADHD brains: always visible progress bar

16•raoarjun4•2d ago•2 comments

What is the most beautiful / highest quality code you've seen (or written)?

30•gooob•4d ago•16 comments

Claude Is Down

5•blitzpoet•17h ago•5 comments

Ask HN: Engineers working AI tools. Are you working more or less?

17•taariqlewis•2d ago•21 comments

Ask HN: How does one stay motivated to grind through LeetCode?

91•blutoot•6d ago•109 comments

Cloudflare is down and causing outages at X, OpenAI

4•paulwilsonn•18h ago•1 comments

Ask HN: What's the Least Amount of Process a Small Team Can Get Away With?

7•_phnd_•1d ago•8 comments

Ask HN: Why is there black line on top? I guess not because of Cloudflare outage

6•cryptography•18h ago•2 comments

Cloudflare Down, Again

6•atlasx1z•18h ago•2 comments

Ask HN: What were the best books you read in 2025?

21•dom96•2d ago•19 comments

Which Class Is Better?

5•elainezzz•2d ago•3 comments

Ask HN: How to learn concurrency?

44•shivajikobardan•5d ago•20 comments

Ask HN: How do you monitor the threads on HN you are engaging with?

15•spacemnstr42069•3d ago•10 comments

Ask HN: Senior people, how did your career evolve?

92•Seb-C•1w ago•52 comments

MCP traffic analysis tool with playground

3•devops-coder•2d ago•0 comments

Ask HN: What could possibly happen so people would want to read more?

5•jstummbillig•2d ago•9 comments

Ask HN: Is Computer Science still a good choice?

23•speedylight•4d ago•35 comments

You've reached the end!