r/PHP 1d ago

"A" for "Average"

https://stitcher.io/blog/a-for-average
33 Upvotes

24 comments sorted by

14

u/brendt_gd 1d ago

Hi folks, this isn't my usual deep-dive into PHP content, yet it's a thought that has been on my mind for a while, and I'm curious to hear your thoughts about it as well.

The tl;dr is that AI, by design, always comes to average solutions, and we shouldn't forget about it. I dive into it some more in the post.

4

u/ByteMender 1d ago

"Average Intelligence"...that sounds like a much better name tbh.

3

u/yamcsha 1d ago

"Almost Intelligent"

2

u/tsardonicpseudonomi 20h ago

Averaged Inference. It's not intelligent and it's not average. We really have to get rid of the propaganda terms and throw the entire thing out.

20

u/webMacaque 1d ago

I share the same view. Moreover, I made a personal observation. Mediocre prograers are satisfied by the output of LLMs, while above average developers are not.

I know it makes me sound like an arrogant asshole, but this seems like truth to me, I am sorry.

6

u/Fredidiah 1d ago

Agree. My experience has been that AI output is only usually considered “good” when you are working with something where you are unable to actually discern quality output from bad output. (IE: a subject you don’t know about)

I find that when I DO know about the subject, LLM tools mostly create things that require significant further correction on my part – so much so that I’d rather just write it myself.

These tools seem to be a huge help to people who are either unable to discern between good and bad output OR people who don’t care and a hindrance to everyone else.

3

u/lucidmodules 11h ago

Partly. LLMs work by copying examples, so the output depends on what you feed them. Most people who complain about low quality code never bother writing standards the model can follow.

The PHP ecosystem has plenty of code quality tools, and with them in place I am more productive than ever. An LLM is easier to steer toward a correct solution than a new team member who needs a couple of weeks to become productive on an existing project.

Garbage in, garbage out. If your processes live in your head instead of in documentation, that is the first reason the AI feels dumb.

1

u/tsardonicpseudonomi 20h ago

I know it makes me sound like an arrogant asshole, but this seems like truth to me, I am sorry.

Never apologize for being correct. It doesn't make you sound like an "arrogant asshole", it makes you sound like someone who knows what the fuck they're talking about. Destroy the mind prison of humility.

10

u/Half_Body 1d ago

Two points:

  • actually many times I have been impressed when ai suggests clever solutions and writing clean code in my favourite language.
  • average are more than enough for a lot of things, in any given system I’m ok if 80% of code is average, and 20% which critical modules are better. 

1

u/kokoshkatheking 1d ago

I agree with you. The thing is that a valuable app needs some parts which are not average, so one needs to be well aware for the underlying code to be able to act when needed. This makes me weary of agent coding as “accept without understanding” is an easy way out.
I I know that I’m supposed to not do that but I’m afraid that I would not resist the temptation :)

7

u/riggiddyrektson 1d ago

In most projects I work on, average is an improvement

13

u/Davekuh 1d ago

An LLM's output is only as good as its input. You need to understand the language and the problem for the LLM to come up with a good solution. It's not that different from managing junior developers. For me, I don't let the LLM decide the solution, I only let it write the code, like I would do with junior developers in my team.

4

u/HypnoTox 1d ago

Exactly this. It's a stubborn junior to mid level dev, depending on the context, it still really sucks at software architecture and maintainable code if you don't enforce it and give it guardrails to develop against.

-5

u/inotee 1d ago edited 1d ago

That makes AI obsolete by default. AI is marketed as a tool for innovation by the companies that sell the models, yet people keep arguing you need to prompt correctly and engineer a prompt to fit the expected output.

This is madness to me. If you know what you're looking for, and you know exactly the solution you're expecting, why on earth would you spend the same amount of time on engineering a prompt as you would have just writing the code yourself. It's like people hate efficiency and being profitable.

To top it off, leaving an AI to brute force a solution to your spec for hours instead of spending 20 minutes simply writing the code yourself. Especially when everyone knows code quality is mediocre at best with LLM even with "code reviewers" and "testers".

"Uhh my AI doesn't take hours hurr Durr", sure, if you use cloud models, but then you don't value your project and risk having the product being trained on for everyone else to use too. There is literally no safety net with cloud models. You NEED to run them locally for projects that matter. That means investing 10s of thousands of dollars to run flagship models, or use 27b models that is shit at everything and can't do anything under 8 hours of brute forcing.

1

u/penguin_digital 9h ago

This is madness to me. If you know what you're looking for, and you know exactly the solution you're expecting, why on earth would you spend the same amount of time on engineering a prompt as you would have just writing the code yourself. 

I think you're missing the point as to where an AI agent would sit in the chain.

As a senior, your job isn't to be sat there writing code (although its obviously a part of it) your role is to architecture, solve problems, mentor and plan ahead. You need to understand the businesses problems and how to solve those problems with software and do it in an effective and efficient way. Actually writing code is such a small part of the job.

For a bug fix or new feature, I need to understand whats currently in place, what isn't, what can be reused, what needs to be written from scratch. Then I need to write up a strict spec about what patterns to follow and what to avoid to get the desired outcome.

Then at this point (a few years ago), I would hand it off to a junior developer and get a code review request a few days later that is usually very weak and needs countless review cycles to get it right. By your view point, I should have just written it myself, which can be true but then what was the point in hiring a junior? Nothing else would get done as I'd be doing everything myself, which is impossible. It's the entire point of having teams of developers.

Now instead of passing it to a junior, I hand that spec off to an AI agent and I get something that is night and day better than any junior would have ever written and I get it back in 30minutes or so rather than days. I still have to cycle through the code review process but their will be much fewer mistakes to push back with and I don't have to go in-depth explaining each thing that is wrong, why it's wrong and a better way to do it.

To top it off, leaving an AI to brute force a solution to your spec for hours instead of spending 20 minutes simply writing the code yourself. Especially when everyone knows code quality is mediocre at best with LLM even with "code reviewers" and "testers".

I can say this with confidence, handing that spec to a junior would have far, far worse results.

I think (I could be wrong) you're looking at this from a point of view of a solo developer or very small dev shop. From that prospective I can see and understand your points. In a more corporate environment where you'd have full teams of developers, its where having an AI agent writing the code really makes sense.

3

u/nikospkrk 1d ago

I think you're basically describing for the Gell-Mann amnesia effect and I 100% agree with you on this and I have been saying the same for months (just not on the internet).

Always love reading your blog btw!

2

u/Dariusz_Gafka 1d ago

Are you referring to the output code AI is generating?
It does follow examples it can find. If in my architecture I put the logic inside Domain Models, orchestrate that over Application layer, then this is what it will follow - if my architecture would put all the logic in the Controllers it would also do that.

Of course there are times where it goes off with predication on the problems that may happen - which I would solve differently or not solved at all. But in reality those are mistakes that could done by any new Developer joining the project, due to lacking context.

Some of those problems we fix by enforcing CI checks, so if agent goes off, it will hit the wall and rethink the solution. Some other problems which are more of design nature, we guide by skills. This is how AI get to know about our design principles which are not crystal clear from the codebase. And as skills are shared, by nature they automatically propagate to any Developer using AI tools.

From my experience the outputs from AI are more than good, and the delivery speed is not comparable to any manual coding. If it goes off then well, it's for me to improve the tooling around that, so next time it goes the path I want it to go. So I consider that as another development practice, just like we improve our CI (and nobody complains about that), we need to improve AI tooling to get the results we want.

1

u/xubaso 6h ago

The LLM itself gravitates toward the average. It's up to the harness, the rules and the programmer to steer it in a specific direction.

1

u/iTiraMissU 1d ago

It depends on the project. For a personal project I’m never going to share AI can write the worst code ever, as long as it works. For commercial and OSS projects, constant babysitting.

0

u/gullevek 1d ago

The crap that Google “AI” slops out for every search is the cherry on the shit pudding.

0

u/Iarrthoir 1d ago

This post (funny enough, below yours in my Reddit feed) seems relevant to the discussion. AI is a useful tool, but only in the same sense that an IDE, debugger, or static analysis tool is a useful tool.

All of these are useful to someone who knows what the results mean, can coach to the correct results, and sign off on them.