Hacker News new | past | comments | ask | show | jobs | submit
Multiple times in my career my teams have received ownership of large projects, often the legacy kind, either though reorgs or layoffs or acquisitions, that we had absolutely no understanding of the code of. It was just chucked over the wall with some docs and runbooks -- maybe a short handoff meeting if we were lucky enough to have the previous owners around. And given that this was typically on top of our existing workload, we did not have the luxury of understanding the new code at all.

The world didn't end. It was a complete black box, but we followed the runbooks and kept things running, and only learnt enough of the code as needed to fix any issues or add any enhancements that popped up. Diving in, doing some software archaeology, and spot-changing relevant code became a skill we had to develop.

At scale and over time, I would guess that the percentage of code running on machines that is actually understood by anybody approaches 0. Yet the world does not end.

right, but the scale was MUCH smaller. And there's usually someone who know someone who has context, so you had someone to call.

I'm working on a repo these days that's larger than _entire companies_ I worked with in the past. A 10-person team maintaining more code than 100s at a previous job. The _scale_ makes this wildly different from what we're used to, no matter how much "legacy code" you had to maintain before.

I used to work on Visual Studio 20 years ago. At the time it was 30M lines of code with a history going back over a decade and about ~1k people working on it. Product cycles were measured in years. Time spent working on new features was measured in months, since no one understood how it all fit together we then had to spend years playing whack-a-mole with bugs, to stabilize it before shipping it. I regularly had to debug through large parts of the stack I'd never been in before. So did lots of other people.

Being able to work effectively in large amounts of unfamiliar code was an expectation for mid-level engineers (L62 if I recall correctly). Its not a new skill, but it is increasing in value again.

Focusing on the scale feels wrong.

These legacy codebases could be incredibly massive and documenting how to run them alone could be a multi month reverse engineering project.

Now ai can do all that part. Dealing with a legacy or unknown codebase is so much easier…

Yes but you are talking about code which you can do archeology on. A given code base may seem a complete mess but you can often understand it by deciphering which programmer created what and what their style and intentions were. I haven't tried to understand reams of vibed code so I am just curious and perhaps skeptical whether any kind of similar process could be used.
It is possible, but I it will be really difficult if the code is not reviewed stringently for simplicity.

What I've found is that even the best models can write very good code "in the small", and the code is mostly correct, but they can be highly problematic in their design, architecture and abstractions they use. The most common problem is that there is a strong tendency to overcomplicate things, and often this can be traced (ironically!) to the agents not having enough context.

E.g. a very common failure mode is that agents are unaware of some invariant in the architecture (or the fact that they could potentially stipulate a new invariant) and write code to handle a dozen edge cases that would never occur. The code is correct, but there's a ton of unnecessary slop.

My suspicion (confirmed by friends and posts on HN) is that at most places, people don't bother reviewing the code and blindly ship all this slop. The reason things haven't imploded yet is a) the code is usually technically correct, and b) all that additional complexity is never exposed to humans -- it is just outsourced to even more agents to manage. Which explains Anthropic's exploding revenue, I suppose.

That said, it's not like things were better before AI. I once had to go Indiana Jones-ing into a humongous legacy Python codebase so full of magic that there were some code paths I could never figure out even with a debugger. I could only tell that if I got a row written to a specific table, some completely disconnected code path elsewhere would get triggered. I suspect what was happening was a function name was being constructed out of 3 different strings from 3 different sources, one of which was a column in the DB row that was getting written, and that function was being eval'd in some thread somewhere.

This was to fix a bug, which I managed to do without ever figuring this flow out. I still spent an inordinate amount of time trying to figure this out before I realized I was being too idealistic and closed the ticket and moved on. I bet an agent would have figured it out though.

Not really. One of my coworkers has been using it more recently, and just pushed a merge request last week that mixes a bunch of different styles with little abstraction. And I don't mean styles like linting, it looks like it was done by three different devs who couldn't agree on functional or object oriented style, or whether "spooky action at a distance" was good or not (extra effort to avoid it in some places, relying on it in others). Plenty of things aren't named well either so you have to look at the implementation to figure out what they're doing. And this wasn't even very big, around a thousand lines greenfield.