← Back to context

Comment by dyauspitr

2 days ago

No one cares about good code. It’s a means to an end. Your code doesn’t need to look pretty or be well documented or any of that stuff anymore because people are not looking at it. The only thing people care about is performant and error free code.

People saying this are telling on themselves that they have no idea what quality code is. It's not about looking pretty or nice variable names.

Code quality matters to AI just as much as it did to people

  • Do you have any data backing this statement? Or is it just your experience?

    • Personal experience:

      AI tends to add new wheels for a new feature in a large codebase, because finding, understanding, and generalizing the existing code to integrate a new feature will likely break existing features, cost more effort (and token) to implement and test. Human reviewers also tend to like these code since they are clean, easy to review, and get the job done, especially when they are not familiar with existing codebase.

      The issue is that wheels like these accumulate in the codebase, and they inevitably entangle. When an upstream specification changes, when a new feature that works with many existing features are introduced, all these wheels need to be revisited, and in many cases they are not because the new test cases do not cover all the paths. The code base got larger and more complex, and contains more bugs than the unit tests can cover, especially when unit tests are often "bent" to fit the wrong behavior unnoticed.

    • I’ve had multiple occurrences (with the latest models) of AI reading a poorly named db column and assuming it was one thing when it was another that resulted in a problem. It does not know when to stop or when to continue with determining what is true.

Literally 50 years of engineering history and culture cares about whether code is good. There are libraries worth of books about it, not as a means to an app but for its own beauty. Just read “The Elements of Programming Style”, for example.

Do what you want, write apps with AI and don’t review code, it doesn’t impact me. The claim that no one cares about good code is demonstrably false, and that’s all I’m objecting to.

  • > it doesn’t impact me

    so long as his software isn't used for anything that can affect you

  • This is true but a lot of that history and culture has not been capable of producing software which has better quality than what came before. Around here banks are spending hundreds of millions trying to exit mainframe systems, and they've been failing for the better part of a decade. This despite having hundreds of people working on "modern" software paradigms in "modern" languages.

    I do think the capabilities of AI depends a lot on how you work. If you're doing very low abstraction, fail fast defensive programming in something like Rust then it's fairly good at writing code with high quality. If you're working in some OOP language with tons of freedom, then my experience is that it's usually not better (or worse) than most human programmers, but certainly much worse than some.

    I've got decades of experience in enterprise development and I've also been an external examiner for CS students. We have people with no coding back ground vibe coding internal tools in Python which are terrible, but not really worse than what we've previously bought from some of the cheaper coding houses around here. At the same time we have AI writing internal SDK's and libraries in Rust which will frankly write better code than I do on a thursday afternoon after too many meetings and too little sleep because the children kept me awake all week.

    Good code can mean a lot of things though. If you're deep into clean SOLID DRY OOP programming I suspect that an AI will produce unreadable horrible code, much worse than most humans. On the flip-side the AI probably knows the difference between a generator and looping over a List. It probably also knows more about JVM optimization than most of those banking programmers trying to replace COBOL with JAVA.'

    I doubt Antropic is a good sample though. Bun is written in Rust and it's a single purpose software, which seem to be an optimal environment for LLM's.

Good code is a means to the end of the code being error (and vulnerability) free, maintainable and performant.

And if people are not looking it, those people don't care about their customers.

  •   > those people don't care about their customers
    

    if it was any other industry like medicine, food, or construction etc, could they get away with just shipping products where they have no idea whats in it?

    where things like "it tastes good to me" or "cement didn't crumble when i hit it with a hammer" is good enough to ship we'd be inundated with lawsuits and customer claims... its a total joke where the software industry is headed

Not true, LLM’s will struggle with badly organized and designed large codebases just the same, though likely with less errors and profanities.

  • The biggest concern is that AI can doxx you and find where you live if your code sucks. If that doesn't scare you, nothing will.

> No one cares about good code. It’s a means to an end.

I do, my coworkers do, my friends do, etc etc.

  • I think a more generous interpretation of the parent comment would have been: "No one [in business] cares about good code" .

    Your end users certainly don't either, heck they'll gladly sit there and scroll through their phone until the 50GB React app loads.

Code that isn't duplicated in 15 places, that doesn't read the whole database to fetch just 1 record, that doesn't do 15 database reads where one would suffice, that uses an optimized algorithm instead of an exponential one recreated badly from scratch... all that is also good code, and is just as important in LLM-slop era.

The way you phrase it makes me realize its almost like a GPL contamination. Eg, once you pull in GPL code, your project is infected and can never use a BSD (or other GPL incompatible) license.

Similarly, once you pull in terrible AI slop code, the project becomes unmaintainable by humans and you need to maintain it with AI.

  • There’s a little irony about the example you picked of the GPL, just because in the US the output of an LLM cannot be covered under copyright. The GPL works as an assignment of rights under copyright.

    This is, of course, tangential to your point.

No code is error free. All code will need a fix of some kind eventually. When it does, it's better that the internals are not a total mess. In the same way that you don't want the insides of your car to be total alien nonsense either.