Hacker News new | ask | show | jobs
by Hasz 4 days ago
I think this is fine? Code used to be very expensive to generate, now it is cheap. Building glue logic between well-defined, well-documented APIs has never been easier or faster. There is a time and place for throwaway code that quickly automates a task. It is fast food to fine dining -- not everything needs to be a Michelin star experience.

However, as always, AI usage is a matter of taste. Including your style rules in the prompt matters. Introduce new paradigms/tools/code into the main codebase because they solve a business problem, not because they are technically interesting. Careful development does not break 7 things to introduce one new feature, etc.

1 comments

I think an important caveat is that LLMs are prone to writing unnecessary code, i.e. there's almost a superfluity to it, that at the same time makes it less straightforward and more prone to unnecessary side effects, which it does catch and handle, but that again expands code further.
Then you add an agent that goes through the code and simplifies it. Before every sprint, you get the agent to simplify whatever it can without losing fidelity.

It's really that simple.

I should probably know better than to interact with a 3 month account called "freediddy", but here we go.

> Then you add an agent that goes through the code and simplifies it

Can you? I just asked Opus to generate a sum function.

    def sum(a, b):
        return a + b
Then I asked if it could simplify it further. I would expect it to say this is simple enough, or just use the actual `sum` function, but it did this.

    add = lambda a, b: a + b
That is, at best, a useless but harmless change.

If you ask it to simplify something, it will make changes whether it needs to or not. Now imagine we were working with a function that is a couple hundred lines. What changes would it make?

The reason something superfluous was written to begin with is because an LLM does not always know what is superfluous. Producing and reading is really cheap for the LLM, so it doesn't have the same considerations we do in writing code. It's more willing to reinvent the wheel or write something that is way more verbose than it needs to be.

In practice, asking an LLM to simplify it just means it adds a different superfluous thing. Or it refactors things that didn't need to be refactored (because it can do it quickly). The result is LLM code, even if it's good, tends to bloat a bit. Multiply that across 100 people all vibe coding and not reading the code base, and soon you have an unreadable mess.

> If you ask it to simplify something, it will make changes whether it needs to or not.

This is false. You can prompt it to only make changes that will have a material effect on the performance. You can create performance tests and have it run the test after every change and if nothing changes then back it out.

You're not thinking creatively enough about how to use AI to your advantage.

> You can prompt it to only make changes that will have a material effect on the performance

Nobody was talking about performance. There's too much handwaving in your comment to really go further.

"Just have a stochastic machine redo the code with no oversight"

This is an utterly terrible idea.

There's always oversight, that's just something you wrongly assumed.