Hacker News new | ask | show | jobs
by greenowl 18 days ago
We fought for quality code mostly for selfish reasons. Because it sucked to work in a messy, fragile codebase.

But AI doesn't care. It can, and it will, happily churn through a messy codebase.

8 comments

> It can, and it will, happily churn through a messy codebase.

Do you have examples of where this actually worked for you? How large was the codebase, how long did you have agents generate the mess in it?

I ask because my experience is pretty different, even with Opus 5.5 and Astra - unleashing agents on a messy, vibe coded repo only seems to increase the mess. The agents just slow down more and more as they keep generating further mess, they make more and more incorrect assumptions based on bad code previous agents left behind, and I grow more disappointed in their capabilities every day.

Actually reviewing all agent output thoroughly is the only effective way I've personally found of working with agents. In order to ensure that every line of code they add is actually there for a good reason, and not organized in a way that future agents will miss it, or misinterpret it. It's the only way I can prevent them from producing worse results as the repo grows.

Actual effectiveness aside, the comment is more about willingness to even work with messy codebases. No matter how messy the code gets, agents can and will continue to push forward. While humans would just get fed up. In the past I've known multiple devs who literally quit and switched jobs from working with messy codebases (you can't always tell what you're walking into during the interview stage).
Good old Garbage In Garbage Out. Only Non Garbage In produces n% garbage on each iteration, so you eventually regress to GIGO.
"Good, fast, cheap" never changes.

Messy, fragile codebases have a greater cost of change and a greater likelihood of errors with every change. AI tokens might be cheaper than developer hours but you'll still burn more of them working on a messy code base, and still have the reputational impacts of a high error rate.

If "fast" and "cheap" are the main drivers, you'll get "bad". And I think it's a great deal easier for developers to follow the path of least resistance and allow "bad" to deliver faster and cheaper when it's AI that's reading the code.

Of course it changes. Compare clothing before and after the industrial revolution. We definitely have good, fast, cheap clothes now, to the point where the second hand market for clothes is pretty much dead and clothes are seen as disposable objects. The same can happen to software. There is nothing preventing disposable software, indeed the number of one-of Python scripts that I use and discard has exploded. With further cost reductions I can totally see the disposability barrier to climb to larger software systems.
Tailored suits vs. off the shelf ones? Cheap imports that fall apart after a few dozen wash cycles? You absolutely still pick two (at most) for clothing.

The industrial revolution may have changed the bounds, but it didn't change the relationship.

Your one-off Python scripts are a bit like handkerchiefs. You can make a one-off hanky by cutting a square off an old sheet, fast and cheap, but it's clearly not as good as a re-usable one and you'll throw it out after using it once or twice. That sort of idea simply doesn't scale with complexity. A "good enough" pair of pants needs a lot more than just snipping out a shape. Even a one-off pair of pants, like for a costume, requires time and effort. So too with larger programs. They require more time and effort.

AI changes the bounds: it's cheaper and faster to produce software than it was, but it's not cheaper or faster to make something good than it was, not by an appreciable amount. It remains to be seen if software turns into cheap clothing advertised on buses that is barely fit for purpose... but the industry's track record isn't anything to praise, so probably, it will.

For an hour at minimum wage I can buy a t shirt that lasts a year or two before it needs mending. That’s ridiculously cheap compared to pre industrial garments, which is why mending rarely happens. Even tailored clothes are extremely cheap because machines weave the cloth and machines do the sewing. Imagine you had to pay minimum wage to cotton pickers, people operating a manual loom and people sewing by hand.
But I think it does. For instance your comment is not all that different than ones I read, what feels like not 'that' long ago, back when hand-crafted assembly was often still significantly better than compiler produced code in many cases. I'd point there not only to the eventual outcome, but also the fact that we're having this debate when there's every reason to expect LLMs to continue significantly improving, much in the same way that these debates of the past were also being held at a time when compilers were still rapidly improving.
Better tools doesn't change the relationship between time, quality and cost. It just changes the bounds on those values. You can use a compiler to compile shoddily written high-level code just as easily as you can use it to compile well-written high-level code. The cost of writing the high-level code is cheaper than the cost of writing equivalent assembly, but the time and cost of writing good code remains higher than the time and cost of writing bad code.

Then, too, hand-crafted assembly still beats compiled output, if you consider the only upper limit on quality. The gap in quality is much, much smaller, and the gap in time and cost is much, much bigger, though, so it's almost never worth the trade-off.

Let's say that AI-generated software eventually (or already, if you like) produces better quality software than people can produce, given the same time and cost restrictions. You can still spend more time and cost to get a better result, or accept a worse result to save time and cost. Or take more time to get a good result but more cheaply using off-peak pricing (tokens or power, take your pick). Or throw more parallel agents at the problem to get a good result faster, but at higher cost.

Pick two. Always.

Upper limits don't matter when humans can't realistically achieve them. There are exactly 0 humans alive today who can write better assembly for any complete program, of a minimum complexity, than a compiler.
That’s shifting the goal posts.

I hit a corner case yesterday in which assembly would give me a better result than compiled code. Emulating an eZ80 ALU on an x86_64 platform means doing a simple operation like add then taking something like 26 more instructions to sort out the flags. Or you can just use ‘mahf’ to load the x86 processor’s own flag results into a register and use them almost verbatim.

It’s still not worth doing, though, since I can easily reach performance targets without.

It's not shifting the goal posts, because when the cost you pay has zero measurable effect, there is literally no difference. It's like if you shaved a milligram of material from a basketball player's shoes, they'd probably be able to run and jump slightly faster, but immeasurably so to the point that people would be much more inclined to look at you like an idiot rather than go grab a razor, if you ever suggested such.

And beyond this you're also speaking of something different. You're talking about taking some output assembly and then modifying it in 'negligible' (as a percent of the whole) ways, as opposed to writing assembly oneself. For a program of minimal complexity, not only would it would require an unreasonable amount of effort, but you'd also invariably write inefficient assembly relative to a compiler. Compilers produce code that is better, faster, and cheaper.

---

Shifting outside the abstract, let's just do an example. Imagine you have a processor running at 3 billion cycles/s and you have a program that takes up to 1 million single cycle ops/s. And then some ultra clever human tunes a bit of the assembly and we get it down to 0.95m cycles per second. In reality you're probably not going to be able to tune your way to a generalizable 5% boost, but even if you do in this scenario - what have you achieved? Literally nothing. Of course this argument, taken to extremes, is why it now takes more processing power to run a text editor than it did to put a man on the Moon, but we're not talking about extremes.

Yeah, code humans can read is quickly just becoming another intermediate language for the AI to work on. We are quickly moving up another abstraction layer. I think part of the challenge for ICs is now we’re all becoming managers, which isn’t something everyone wanted.
Yeah but if you don't keep tabs on it, you might not know what to prompt it to fix. For example, early on I established in my fun proof assistant project, that I did NOT want total functions (1/0 should not be permitted, 3-4 not permitted in N), and it seems to have forgotten that along the way and it took a 2 day struggle session to remove total functions from the standard library.

Managed to get it in time to have an accurate claim that "stdlib has no total functions" prior to presenting it to someone semifamous, who doesn't like that lean has total functions

I think you are underestimating the spiral effect. Working with a documented and structured code makes it easier to understand and reason with even for LLMs. At the end of the day its working with patterns, grammar, trying to deduce and implement intent. Its possible where we enter the era of blackbox applications where no one knows the internal, and yet for the required inputs it provides the expected outputs. Every failure would re-trigger the evaluation of the whole application to accomodate that one failure in requirement.
> But AI doesn't care. It can, and it will, happily churn through a messy codebase.

Even if that will be true (currently it's not in the long run), messy codebase will make you spend much more on tokens. So unless agents become so cheap that it won't matter, having a mess will be bad for the business in the long run.

This is not anything new. I found the same pattern when I started working at a company which heavily relied on an IDE and intellisense for embedded development. Naming and code organization best practices can be ignored if you have "go to definition" available to navigate the code for you. The code base can be messier - up to a point - because you can offset the messiness with tooling.

LLMs are the next logical progression of this trend.

> We fought for quality code mostly for selfish reasons.

Also what does quality mean really? Because recent AI audits show that we humans have been generating low-quality software in terms of security.

Readability and maintainability is less of a problem for AI. One can argue that they’re potentially better for writing and running tests. Same for writing performant code.

Additionally, all those arguments about tabs vs spaces, position of the curly brace or different naming conventions have zero meaning now.

... and now the people who wrote that low quality software are potentially the ones who can't see when AI generated code has its own problems.
I agree. And while AI does better when there is less tech debt, at the same time paying down tech debt has gotten immensely cheaper.

I find myself desiring simplifying a codebase just because I still need to make so many decisions and the cognitive load of that has gone up with how much I can do in parallel and still keep track of.