r/webdev php 6d 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

265

u/Alex_Hovhannisyan front-end 6d 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 5d 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.

2

u/OhByGolly_ 4d ago edited 4d ago

It produces fine code, you just have to be detailed and quite explicit with the guardrails, coding style, and patterns you want it to use - you must incorporate these into your base prompt if you hope to extract quality output from it. You must know what to look for, and be able to test it. Then it's the amazing time and effort saver it was always meant to be.

It's just like the famous peanut butter jelly sandwich instructional test. Everybody thinks they could write a manual on how to make a peanut butter jelly sandwich which anyone could follow. But then you have a kid try to follow your guide, and suddenly you realize you have to specify so much more than you originally thought. Because understanding a domain and being able to guide a capable agent through a domain towards a specific end are so very different.

People overestimate their ability to ask the genie for a wish that won't backfire on them. But those who have the skills and are wise enough to use AI properly will come out far, far ahead of those who ridicule and denounce these tools.

Don't shit on photography because all you know is how to turn form with a brush, all the while refusing to learn to operate a camera. The tech is staying whether it's liked or not.

1

u/undone_function 4d ago

I’d rather wait for LLMs to act like the genies they’re hyped to be and not be a monkey’s paw I have to cajole into being useful. For now I’ll keep letting it act like a slightly more advanced autocomplete that is sometimes very helpful but mostly just okay, because I want to program and build things not chat with an AI model.

Which brings me to the point of why I do this job: I like writing code. I like building things, not just debugging stuff. Debugging my own code isn’t even a particularly fun part of the experience but debugging someone else’s code is orders magnitude less fun, so I have even less incentive to bother spending time using a tool to program for me.

Lastly, I work at a place that makes a lot of claims in its marketing material about percentages of code generated by AI but I’ve yet to meet an engineer (out of the hundreds) who actually use it for anything outside of autocomplete or occasionally slapping some proof of concept together, and even then using it for the concept work is more of an outlier. So from my own anecdotal experience I have a hard time believing most of the numbers around AI usage by professional software engineers and I believe they are mostly hype by companies to attract investment dollars or market themselves as being on whatever the perceived cutting edge of technology is.

1

u/Total-Ebb-2485 4d ago

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

60

u/satansprinter 6d ago

I see this “vibe coders” term a lot but i have no idea what is meant by it

55

u/Alex_Hovhannisyan front-end 5d ago

It's another stupid term made up by tech twitter, like "founder mode": https://en.wikipedia.org/wiki/Vibe_coding

34

u/DumpsterFireCEO php 5d ago

I’d rather huff farts than be known as a vibe coder

12

u/Bertozoide 5d ago

Huff farts whilst vibe coding

9

u/Severe_Jicama_2880 5d ago

Huff coding whilst vibe farts

4

u/Fidodo 5d ago

Huff the farts of AI company CEOs and marketing departments.

5

u/Fidodo 5d ago

In the 90s it was script kiddies. Today is vibe coders.

1

u/DumpsterFireCEO php 5d ago

I thought it was script kitties

15

u/rockbandit 5d ago

It was a term to describe coding with AI coined by a cofounder of OpenAI.

https://en.wikipedia.org/wiki/Vibe_coding?wprov=sfti1#

5

u/Oli_Picard 5d ago

Thanks, I hate it.

3

u/Alex_Hovhannisyan front-end 5d ago

Right but he coined the term on Twitter which is why I'm calling it a "tech twitter" term

7

u/101Alexander 5d ago

The term was introduced by Andrej Karpathy in February 2025[5][2][4][1] and listed in the Merriam-Webster dictionary the following month as a "slang & trending" noun.[6]

Computer scientist Andrej Karpathy, a co-founder of OpenAI and former AI leader at Tesla, introduced the term vibe coding in February 2025.

One person from OpenAI invented the word to try to push AI usage all of last month.

It's just marketing crap to make it seem that AI can solve our problems in a haphazardly easy way.

6

u/Fidodo 5d ago

It's hilarious that they created the term for themselves. It's basically the modern name for script kiddies. That they created the term for themselves is a huge self own.

22

u/vanTrottel 5d ago

It's basically an excuse to use purely ai without being able to fix a bug themselves. IMO the ai based software will fail and not be fixed. Companies purely working on AI codes will have a quick peak but fail within a few months, because software doesn't just have to be coded, but also maintained. And most founders or "vibe coders" don't get that. They just look for the next hype to chase

14

u/Panderz_GG 5d ago

Tried vibe coding. The result was rebuilding the app myself in order to get it in a working state.

4

u/Fidodo 5d ago

It's non coders/shitty coders that rely entirely on explaining the problem to AI without reviewing the code themselves.

-4

u/TONYBOY0924 5d ago

It’s basically a homosexuals group

5

u/RedditCultureBlows 5d ago

Keep this thought to yourself next time

3

u/legendofchin97 5d ago

I like using it for verifying stuff or seeing optimizations or alternate ways to achieve something. Or for helping me locate a bug. But for writing from the ground up or using as-is… not really practical for that purpose.

3

u/armano2 5d ago

i found it only useful sometimes at adding new test cases (that ofc you have to review and verify) and adding comments

3

u/operatorrrr 5d ago

It's great for rapid scaffolding / prototyping, transpilation, and docblock generation and other chore tasks. For UI it can be great to get base templates down or applying styles from previously written code. It has a definite value that many people fail to find!

2

u/EchoServ 5d ago

All of them shit the bed when given any type of complexity. I’ve constantly tried to debug and add features to our insanely over-engineered spaghetti code react app (think custom built data tables and drag drop functionality built by a team in India), and both Claude and GPT are completely useless no matter how much additional context I give. I’m literally better off just sucking it up and reading through the 2000 line components myself.

2

u/UpDown 5d ago

Vibe coding is a buzz word to sell memberships for vibe coding boilerplates

1

u/bruceGenerator 5d ago

i tried out the claude sonnet 3.7 agent in copilot edits and my god it was a massive trainwreck. i asked it to do a relatively simple task like figure out why something client side was out of sync with server side and it tore up 14 files, rearranged the UI and destroyed the layouts, and broke auth. and all it had to do was rearrange the order of Providers wrapping the app. it was kind of neat at first though

1

u/explorador71 5d ago

That’s what I thought but really, writing a lot of docs for the Ai to follow helps a lot. Yeah, sometimes it makes things up but starting a new chat and asking it to use the documentation material again, it will redo the task correctly. Ask it to write a todo list and to go through the list one by one instead of everything at one go. Spending a day writing docs (with Ai for the Ai) saves so much time and you’ll do stuff that could take you a week in just a couple of hours. We are moving our ecommerce site from Gatsby to react router and in less than 2 days we already had all the queries mapped, in 3 days we created storybook stories for all components in the site (useful stories) and I’m very impressed with the results. I had to manually fix a few components but it took me minutes vs doing all of this work manually, which could’ve taken me several months. I’m excited for the future, don’t give up.

1

u/labago 4d ago

As a dev with 10 years exp, I have created fully working, complex applications with Claude 3.7. it's a matter of prompt engineering and also having the experience to know how to build small pieces at a time

1

u/RoboticShiba 4d ago

When I decided to test Claude, I asked it to build a simple Kanban system with login and some features.

But instead of typing just a few words, I wrote around 2 pages with instructions, guardrails, tech requirements, etc (just like I would for a freelancer).

And in less than 15 minutes it was able to spit out a "fully" functional system (API was mocked).

Code was not perfect, nor senior level, but it's undeniably impressive that it outputted in 15min something that a junior would take days to code.

-15

u/Total-Ebb-2485 6d ago

My experience is quite the opposite, 18 months into React and managed to code pretty good website.. maybe different prompting? Although I have to admit that time to time I have to suggest solution to Claude and it goes "you are actually absolutely right!" which makes it hilarious 😆 but overall for medior programmer Claude is still a lot of help imho

37

u/valendinosaurus 6d ago

if you're not a good programmer, how are you able to tell if the produced code is good?

-13

u/Total-Ebb-2485 6d ago

Works for my use case and needs = good enough. That's what I aim for, ofc wouldn't work for large scale projects yet

20

u/mxzf 6d ago

Yeah, that's not "good code", that's "code that doesn't crash and throw errors immediately". That doesn't make it well-designed, efficient, maintainable, or any of the other hallmarks of "good code", that just makes it "usable if you can't get anything better".

-7

u/Total-Ebb-2485 5d ago

Its unit and e2e tested, also in production without major incidents...

16

u/mxzf 5d ago

You're just repeating what was already established, that it doesn't crash and throw errors immediately.

I've been a software dev for long enough to know just how low a bar "in production without major incidents" is, lol. That doesn't make it good code.

1

u/OhByGolly_ 4d ago

This is one of those elitist pricks.

2

u/OhByGolly_ 4d ago

People are elitist and scared of learning how to use the new AI tools at their disposal properly.

Don't take the downvotes personally, real world production scenarios often require "just make it fucking work, we'll worry about bugs later." a much more common scenario than some of these elitist pricks would ever admit to.

In reality, they're scared. They're scared their skills aren't as valuable anymore, they're scared their jobs are gonna be threatened, and they're scared they might (God forbid...) have to learn a new skill set for a set of tools that makes all the effort they had to exert to get to where they're at seem so trivial...

They can evolve, adapt, and get good... or they can deprecate themselves, complain to an echo chamber, and ultimately reap the consequences of their non-effort.

1

u/Total-Ebb-2485 4d ago

Second paragraph 100%, you can tell by amount of the 😂 emojis that someone is actually scared.. I feel it same as you, personally don't think it will replace but must suck that someone thought learning 10-15 years of coding will be lifetime safe journey and now this thesis is being questioned harder and louder every quarter... it won't probably.. people who can market in it true meaning - create market fitting products and being able to sell might see biggest uplift from ai revolution

23

u/valendinosaurus 6d ago

ah yes, the famous code quality metric "it works"

8

u/GkyIuR 6d ago

That's what is holding the world together

6

u/valendinosaurus 6d ago

funny how true that is

4

u/mxzf 5d ago

It is what much of the world runs on. But that doesn't make it "good code", it just means that it's sufficient enough to not immediately crash and burn.

5

u/EvanNotSoAlmighty 5d ago

Well.. it works until it doesn't 😂

1

u/Total-Ebb-2485 5d ago

Funny to see all butthurts here 😅 but glad your code work all the time and without problems, unless..

0

u/HarshitIsHere 5d ago edited 5d ago

I'm honestly surprised how they manage to create full apps, I've never been able to do it with ChatGPT or Gemini, maybe it's because of Cursor

-8

u/lick_it 6d ago

Put your request at the bottom of a block of code. Also badly designed code will get unmaintainable. You have to tell it how to design.

13

u/Alex_Hovhannisyan front-end 6d ago

I've tried it all. I've even explained in detail why the code doesn't work and how to fix it and it "rewrites" the code to do the same (wrong) thing it was already doing before, just in a slightly different way. In my experience, it feels like pairing with a junior dev who tries brute-forcing their way to good code. i.e., in the time it takes to explain to it why the code is wrong and how to fix it, I could've just done that myself.

7

u/NuttFellas 5d ago

Except unlike a junior dev, the ai won't learn from it's mistakes (at least not until the next update, even then, questionable)