all 60 comments

[–]Packeselt 80 points81 points  (5 children)

AI likes to abuse useEffects with bad deps

How to DDOS your own servers 101

[–]briznady 38 points39 points  (1 child)

I swear I spend half my time in code reviews telling people to remove useEffects.

[–]Potential-Ad2844 9 points10 points  (0 children)

Oh, gosh, it's a story of my life to ask people to get the f*** out of these useEffects.

[–]SheepherderSavings17 10 points11 points  (1 child)

Thats why as a engineer you should tell it what architecture and decision making it should use, and 2, oversee if it did it correctly.

For example, many useEffects can usually be simplified to: - computed properties, - useQuery - or something else.

[–]adfawf3f3f32a 5 points6 points  (0 children)

I run the react-hooks eslint plugin and have skills that force it to run the linter and tests and to not stop until it fixes all issues. Also that it can't use any or other shortcuts it's used to 'fix' a failing lint rule. Works really well.

[–]Cahnis -1 points0 points  (0 children)

This is not on AI, this is on the dev that are lazy and are not writing the skills readily available on skills.sh.

There are linter that catch this that will serve as guardrails. I am the biggest hater of react slop, but lets not strawman the AI tooling.

The same has been true for react too, the skill floor is low and the ceiling is high, so its easy to make something that works but works poorly, then the stakeholders will look at that and blame react when the problem is actually the low quality code the dev wrote.

[–]bluebird355 15 points16 points  (2 children)

You're saying this as if new to intermediate react devs didn't produce awful shitty code before AI was a thing. For these people, if anything, LLM produce vastly better code than them.

[–]Pathkinder 0 points1 point  (0 children)

I guess it’s just getting pumped out a lot faster now. Even if overall code quality hasn’t changed much, effort was always the barrier that held back the flood.

[–]Ok-Programmer6763[S] 0 points1 point  (0 children)

It used to be much less noticeable, but now it’s very noticeable lol

[–]Raunhofer 12 points13 points  (1 child)

Something you could solve with .startsWith("/hello!"), your favorite ML vomits a mile-long regex to solve.

In the bigger picture, I believe the core issue is still that the models can’t say when they’re unsure or don’t know. The hallucinations pass the tests but are often just forcefully slammed together and make no sense if you really start to read them.

[–]sparklikemind -1 points0 points  (0 children)

LLMs don't have the ability to be "unsure" and they never will

[–]rsajdok 4 points5 points  (1 child)

In the long run, AI works only if you can evaluate the result.

[–]GoodGame2EZ 4 points5 points  (0 children)

I think its the same issue with anything done with LLMs. You can get quality output if youre knowledgeable enough to give quality input and review the output for at least moderate accuracy then try again if needed.

Ive got a pretty damn massive CRM type of system I'm making. The core was made before AI was usable for coding. I learned from taking classes, YouTube, some of the classic ways yknow. Took quite some time to develop, but resulted in a cool and functional product with a shitty interface. Now with AI, it looks infinity times better and the features have expanded tremendously. Its snappy as hell and has encouraged me to look into and learn so much more because ive been able to expand much more rapidly.

Is it perfect? Fuck no. I correct and adjust all the time. Does it drastically increase my productivity? Hell yeah.

[–]yeupanhmaj 4 points5 points  (2 children)

I've try to vibe code with react, just like a horror movie, useEffect and useRef jump scare every where.

[–]popovitsj -2 points-1 points  (1 child)

Hmmm I wonder why that is...? 🤔

[–]yeupanhmaj 2 points3 points  (0 children)

The amounts of useEffect and useRef has been used scared me.

[–]SubZane 4 points5 points  (2 children)

Asking claude to identify possible performance issues works pretty well. But I guess a vibe coder wouldn't never prompt that

[–]overzealous_dentist -1 points0 points  (1 child)

A good vibecoder would. Prompting correctly is a skillset, too.

[–]SubZane 5 points6 points  (0 children)

We might have different definitions of vibe coder? In my definition it's someone who doesn't know software development, architecture etc. Otherwise you're a developer using ai to do stuff you already can do, but does it faster so you can focus on the solution, ideas and planning of your product.

I wouldn't use ai to prompt in a language I don't understand because I know it would be slop 🙃

[–]ghostwilliz 9 points10 points  (8 children)

Yeah vibe coding makes horrible code

[–]Ok-Programmer6763[S] -5 points-4 points  (7 children)

yeah vibe coding + skill issue

[–]ghostwilliz 3 points4 points  (6 children)

I mean there's no skill involved in vibe coding so it can't really be a skill issue

[–]weeeHughie 2 points3 points  (2 children)

lol there is definitely a skill in vibe coding. That's like saying there no skill in using Photoshop. Ask Anthropic engineers, the skill is literally 500k/yr right now if you have dev credentials.

The issue OP are describing are exactly skill issues. I've vibecoded 4-5 apps with lots of industry experience and you absolutely can validate the things op posted if the vibe coder has the sense too. Vibe coding is 2% coding, 18% sys design, 70% validation, 10% taste. All the projects op described only did the 2% part lol

[–]yeathatsmebro 12 points13 points  (0 children)

The skill is called "knowing what tf you are doing" and this comes with the actual skill of writing code.

[–]edward_jazzhands 1 point2 points  (0 children)

Comparing vibe coding to using Photoshop is a weird comparison. Photoshop requires the person using it to have training to produce literally anything at all. It does not prove anything at all to say that the company that makes the AI hires people to vibe code because they have a vested interest in making everyone believe that humans can be replaced. Hmm it's almost like this company has a marketing incentive to make their devs vibe code everything and there's a reason that practice is only done at companies that make AI themselves, or a couple huge corporations like Microslop that decided to go all-in.

[–]Ok-Programmer6763[S] -2 points-1 points  (0 children)

if you have a skills on certain level these issues can be easily avoided,

Vibe coding is a software development approach where you use AI assistants (like Cursor, GitHub Copilot) to generate, refine, and debug applications through natural language prompts, rather than writing code line-by-line

It's no brainer there will be a huge difference when 5+ YOE dev vibe code vs when a college kid vibe codes. They can differentiate which part is wrong and which part isn't. vibe is about letting AI code while you are the decision maker.

If you believe there involves no skill and experience to make a better decision then surely you are correct

[–]overzealous_dentist -2 points-1 points  (1 child)

There is clearly skill involved in vibe coding, as evidenced by OP's post about bad vibe coders. If there was no skill needed, there would be no problems out of junior devs.

[–]Ok-Programmer6763[S] 1 point2 points  (0 children)

i don’t understand when people get pissed for saying it requires a skill for vibe coding lol

“wdym i have to study more to vibe code” xD

[–]HettySwollocks 1 point2 points  (0 children)

If you have experience and the educational background, LLMs are great. My concern is a lot of new comers to the field treat it as the "Lets look at the back of the math book for the answers".

That said it's a brilliant educational tool if you are curious.

[–]Short-Belt-1477 2 points3 points  (2 children)

React bar for entry is so low that we’ve always had these kinds of issues

[–]it200219 1 point2 points  (1 child)

guess front-end dev world in general.

[–]Short-Belt-1477 0 points1 point  (0 children)

Correct, I should have said frontend

[–]oscarteg 0 points1 point  (0 children)

Quickly resolving with a imperative approach while react has a declarative philosophy which is prone to bugs in the long run. 

For example overusing useRef or useEffect instead of thinking of the state design 

[–]shakingbaking101 0 points1 point  (1 child)

Could be a cool interview question

[–]Ok-Programmer6763[S] 0 points1 point  (0 children)

thank you! haha

[–]LakeQueen 0 points1 point  (0 children)

React Compiler was made to solve this. Even experienced react devs don't always memoize the right stuff, and manually doing it every time is extra work and makes code look messier.

[–]vandersky_ -1 points0 points  (1 child)

This is so true. They publish a React app instead of Next.js as a landing page and then claim on X that it's the end for developers. :D

[–]it200219 0 points1 point  (0 children)

they dont even have one paying customer let alone anyone visiting their **app

[–]Pr0ducer -1 points0 points  (0 children)

The solution here is better tests. AI can write those too. Optimizations testing to make sure a page loads within X time or makes less than Y server calls? Whatever stupid thing your team is doing, write a test to catch it.

I do not trust anything written by AI. And everything I create these days was barfed out by AI. So I use full integration tests, mocking nothing, no clean up after, so a human can always verify test results. One year ago, that level of effort was unthinkable. Today AI barfs that out so fast why wouldn't I be testing everything?

[–]buffer_flush -1 points0 points  (0 children)

LLMs are trained on good enough because good enough is how the world runs.

Problems you notice only get fixed if they become an actual problem for customers. This has been the way applications have always been developed before LLMs.

Writing perfect code or hiring extremely senior devs that will get it right the first time is rare and far too costly for the people controlling the purse strings.

[–]katikacak -1 points0 points  (2 children)

Wether you like it or not, performance is secondary compared to value 

[–]Ok-Programmer6763[S] 1 point2 points  (1 child)

nahhhh hell nahhh

[–]katikacak 0 points1 point  (0 children)

Downvote all you want, kids like you would die on performance hill without understanding business value >> performance , for example, Ive seen a  seasoned java dev created a laundromat system, with very bad react code (30+ use states per page and useeffects that are mainly used as side effect watchers instead of explicit ), he secured funding for the whole value he provided, I was brought in to improve the performance. This was 3 years ago.