← Back to context

Comment by WarmWash

10 hours ago

AI writes code like that, but people get pretty upset hearing it.

The program that I use to manage my small business, basically a GUI wrapper on an sql DB is a total delight to use, because everything happens instantly. Even opening it is instantaneous.

Modern software is such a bloated mess that you kind of get used to a 20 second start-up and a .25-1 second delay on every action. Then you use something that isn't bloated junk and it feels like actual magic.

>> AI writes code like that, but people get pretty upset hearing it.

To this day I never saw an AI write anything less than a 3Mb binary. Do you have specific examples in mind, and if so, can you share them?

  • AI currently writes median-good code which is by definition better than the worst developers' code.

    In order to push beyond that (e.g. architecture, size, performance), the human has to bring the constraints. There's only so much AI can/should default assume from "write code for me" (which I expect a lot of bad / non-HN developers are doing).

    It is exciting that there's an opportunity for global improvement though! After the general model improvement pace slows, expect there will be a lot of room for code gen AI optimization, and if "write code for me" can be made to generate more efficient code... suddenly all AI-generated code (read: most code) will improve.

    Shit code is out in the wild because the company decided to optimize for programmer labor cost instead of code efficiency. If instead apples:apples because AI code gen is being used both ways, everyone wins.

    Feels like what I imagine were the early days of optimizing compilers, when I'm sure there were a large number of really bad assembly programmers out there.

AI does this when it's not warranted, and even happily writes two functions with the same purpose.

  • Forty functions with the same purpose are still better than importing react.

    • What do you mean my hook to dynamically build <span contenteditable="true" style="border: 1px dashed #ccc; padding: 4px 8px; border-radius: 4px;">input your username here</span> with inline CSS is worse than using <input>? All I need to do next is to listen to form submit to build a new formdata object to POST to the server. Easy!

What happens if you keep asking AI to rewrite it to use less and less resources?

> AI writes code like that, but people get pretty upset hearing it.

Yeah, people get upset when you spew out total bullshit.

I work as a performance specialist and "AI writes code like that" is utter nonsense. AI writes the same terrible performing code that was the mediocre developer standard on Stackexchange and other codebases it ate.

You still need a lot of vigilance and time to make well performing software and most software engineers just don't give a damn if we don't outright block their PRs/feature launches before passing performance tests.

  • LLM coding assistants have a bias towards writing standalone implementations instead of pulling in libraries to do a job, which does tend to sidestep probably the most common cause of bloated software: pulling in too many layers of abstraction. Most software can be pretty damn fast (at least as far as users are going to notice) without needing too much of a focus on optimization, but just by not accidentally screwing it up.

    • Just writing your own bloat is not the way to go though, especially when it makes the codebase quickly balloon...