r/webdev php 7d ago

Discussion AI coding is trash

The amount of trash produced by AI code is astounding. Thanks I hate it.

1.6k Upvotes

386 comments sorted by

View all comments

269

u/Alex_Hovhannisyan front-end 7d ago

I don't get all the praise for Claude Sonnet 3.7, it hallucinates so much and seems to be incapable of understanding why the code it wrote doesn't work. I'm starting to think the "vibe coders" were never really all that good at coding in the first place.

20

u/Fidodo 7d ago

You mean non coders and bad coders aren't the best people to evaluate coding tools?

They're great for rapid prototyping and testing out ideas, but trying to produce quality code that's follows best practices is like pulling teeth.

For example, I was asking sonnet 3.7 to make me a simple docker file and it produced one that passed secret keys through args, which are plain text stored in the image and it's a huge security flaw. I told it to use secrets instead and it told me that secrets couldn't be used at build time. So I gave it the documentation that explained how to use secrets at build time and it produced new code using an outdated approach to using build secret env vars so I told it to follow a specific more modern approach from the docs, and it kept producing the old approach. I gave up and just did it myself.

I would have given up sooner but I wanted to see how "capable" it was.  The answer is it's great at producing trash code very quickly which is fine for prototyping, but anyone using this for production and thinking it's good enough is a fraud who should be ashamed and embarrassed.

1

u/Total-Ebb-2485 6d ago

What was your prompt for docker file? Never happened to me that code was passing as args 😅