Hacker News new | ask | show | jobs
by Twirrim 54 days ago
It's really depressing watching brilliant software developers and engineers producing the worst, unmaintainable code imaginable, and being okay with shipping it because it's passing the test suite. Assuming the test suite is any good anyway (because holy crap, the nonsensical tests AI writes...)

Your code used to be a masterpiece, so well crafted it's easy for AI to tweak and modify because you've got everything so logically organised and scoped... and now this is what you're producing? Hard to debug monstrosities that only an LLM can realistically bolt new features or tweaks onto, because it can do the kinds of refactoring necessary each time.

We use to talk about the fact that code should be readable because you spend more time reading it than writing it, but I think that misses the key part that readable code is also typically easier to debug. If you can read and understand the code, you can follow the logic when things are wrong in production, and you can more easily reason about the emergent properties of interactions between the complex systems that are involved.

5 comments

Your code used to be a masterpiece? Ours was more… Amazon basics wall art.

I jest, while in agreement with this whole comment. We used to care about fostering informed developers and maintaining high standards and good quality software.

I literally compared it to being an expert woodworker. Beautiful ornate decoration. Rich, sturdy mahogany, one of a kind, beveled edges and a fantastic stained hardwood.

Now it’s the 30$ Ikea cardboard stuff.

My biggest question is how many tables does the world need, and how many woodworkers will be required to build + maintain those table factories.

It's getting off topic, but I think a major reason for $30 cardboard tables is the strange modern idea that furniture isn't part of the house.

If you buy a house or rent an apartment in most of the US, any furniture will be stripped out, even if the only thing you plan to do with it afterwards is throw it away. Then the new tenant provides their own furniture, which they either moved from elsewhere at great expense or had to purchase on the spot. No part of this makes any sense. We don't strip countertops when selling a house even if they're unfashionable, we don't replace white goods, but somehow it's expected for the furniture.

If you buy a house in Hawaii, it's understood that you're buying the furniture that's already in the house. I assume the reason is that it's more difficult to obtain new furniture in Hawaii.

If you rent an apartment in China, it will come with furniture, because how else are you supposed to live in it? And if you're not happy with the furniture it's shown with, you negotiate with the landlord for the furniture you need.

If Americans sold their furniture when they moved instead of throwing it away, you'd see everyone using much higher-quality furniture. It would have come with their house. And providing it to houses that didn't have it yet would be an investment, just like the countertops.

  > If you rent an apartment in China, it will come with furniture, because how else are you supposed to live in it?
+1 this. not in china, but same for me when i was a student; it was a godsend
Certainly mostly what I did wasn't great but throughout 20+ years I think at some point I found a balance between "doing this shit because someone f'cking overpromised" and "I am doing this because I want a brain teezer". But it is not like I always do the same. I understood that there are times to do things in one way and times to do in another way.

I think with AI, most people are getting lazy to do it properly.

The other day, I deleted 65K LOC that were dead code or stupid explanations over very obvious code from a vibe coded repository which had 95K LOC (but should have 10k imo)

I always like to say that LLM-produced test suites aren't for testing software correctness or validity, they're for testing to make sure that stuff that was previously in place stays unchanged. This, of course, is six-in-one-hand-half-a-dozen-in-the-other since the agent will often just update tests to match the updates it just made, but I do find value in providing some kind of continuity to a codebase that's being modified at breakneck pace. YMMV
Yep. The only reason for automated testing is to enable future refactoring, which might be needed for future development. If we only wrote software once, we wouldn't need automated tests. You'd just write the software, test manually as you go, then ship it when you're happy. Ideally not all future development would even need any refactors. A good software architecture would allow one to add features simply by adding more modules of code. But, of course, we don't know what the perfect software architecture is from the start, so we need to assume someone will one day need to refactor.
Nice point. But I still have way too many vibe coded tests that passes and break in production despite they should have failed but Claude fixed the test by mocking the test to pass. I am not kidding.
I don't know which companies you work for. Where is the code a masterpiece? In all my work, I have yet to see this elegant code. Before AI, we had to deal with human slop. Byzantine, spaghetti messes. I haven't been lucky. I once worked with code that made me want to pull my hair out. I look at LLM-generated code, and it's mostly better than any code I have worked on. But maybe it's just me.
>> I once worked with code that made me want to pull my hair out.

Only once?

Oh god, we're gonna do the four Yorkshiremen, aren't we?

I’ve seen people say this kind of code was written, but I’ve never seen this kind of code anywhere I have ever worked.

Not saying it doesn’t exist, just saying this sounds dangerously close to a boomer talking about the 1950s

> I’ve seen people say this kind of code was written, but I’ve never seen this kind of code anywhere I have ever worked.

Luckier than me. I've worked at a few places where the code was simultaneously brilliantly written[0] and also unmaintainable nonsense that caused endless problems. One place had its own object model and ORM that absolutely no-one currently at the place understood and literally every bug filed (whilst I was there) could be traced back to that code.

(Probably just a coincidence that most of those places where Perl shops but I've seen it with Go too...)

[0] In terms of "cleverness", not in terms of "maintainability" or "readability".

> Your code used to be a masterpiece

Do you even see anything underneath that rose tint ?

There's this amazing rhetorical technique called hyperbole. Compared to what I'm getting from co-workers, and in code bases I'm subjected to these days, what I used to have to deal with was a masterpiece.

I've waded through unfamiliar code at 3am trying to figure out just why the hell things broke this time more times than I can care to remember, particularly trying to tease apart the ways that code has organically grown compared to the original intent. If I'm subjected to one more piece of "spooky at a distance" injected behaviour code I'll probably scream loud enough to be heard half way across the country.

It's still just leaps and bounds more readable than what people are slopping together (I do have some co-workers that have been extremely tightly focused on avoiding "slop" with their AI and doing a lot of tuning, and it's certainly preferable to the ones that haven't)

TBH I'm seeing the opposite, I have a legacy codebase where the people originally writing it were incompetent and inexperienced, but the project took off. It's scaling up but the foundation is shit and has to be gradually rebuilt. Every AI slop commit is still better than the underlying crap.

And this is the pattern I've seen on most (semi)successful projects I've worked on in the past - I'd say correlation between financial success and code quality is 0 (up to a point where the whole thing doesn't fall apart). Once scale (both in load and in code size/features) starts mattering you're stuck building on a foundation of shit. LLMs are very good at identifying and cleaning up said shit layers, as long as you're steering them towards a desireable outcome.