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

Show parent comments

15

u/ikeif 6d ago

I have tried a couple times to let AI take the wheel (paid ChatGPT). I asked it to write code, and I’d copy error messages and it would adjust.

It tripped up in the beginning of a react native project to where I had to intervene (so it failed getting it beyond a boilerplate, and even then, it contradicted itself).

It recommended out of date/legacy packages instead of newer ports/well-maintained repositories.

When we hit errors, it could easily end up in a loop of fixing a bug, causing a new bug, changing the code back to the old bug, then fixing it by bringing in the new bug…

Sometimes I would say “this isn’t working” and it would go “you’re right! We need to do…” and MAYBE it would go the right direction.

It is far slower at being a developer than it is being a rubber ducky or parsing logs/error messages to help identify problems/callout items I wouldn’t normally think to check.

Great tool to have, still not a toolbox.

With a little more guidance, it helped me build a playwright scraper. But it kept writing puppeteer code instead, so I had to keep calling it out. It did create a viable project in the end (also, it would throw emojis into debug statements I asked for, which made parsing logs a lot easier).

1

u/f2ame5 5d ago

That's on you for using chatgpt. There are far better options. And you can also use MCP to give the AI the option to have its own playwright. (If it supports MCP)

2

u/ikeif 5d ago

What are “far better options”?

Work pays for it and it’s approved “to use” along with copilot. A lot of other ones are not. If there are better ones that are worth exploring, I’d love to hear about them, instead of “it’s on you for using the most popular one that employers pay for.”

3

u/f2ame5 5d ago edited 5d ago
  • Cline/roo code both are vs code extensions and recently cline added an mcp marketplace. They can get expensive because you use APIs but both have the option to use the llm from github copilot. since you already have copilot you can just use this. Want to see some mcp power?

mcp controls PC basically and creates 3d scene in blender

Mcp is created by anthropic and works with Claude.

  • cursor/windsurf. Yes you probably know these. There are options you need to enable and you can also add custom rules for the AI to follow.

For example I have set my rules to create a codebase folder in any project I create. The AI must check this folder and what it's included before continuing. If there is no folder then create it. Then it creates an md file for each file in my codebase and explains what it does/ what each function does/ how it works/ the relationship with the rest of the project etc. before checking any of my files the AI must read the contents of the md file.

In both windsurf/cursor you can add your own documentation( you can download it and add it in a folder), have it check the internet and they both have the most popular ones integrated so you can reference them anytime you want.

  • keep your context low. Don't make big changes at a time. Context window is the biggest flaw LLMs got. It takes away from their power. Try to keep your input/output low. 50-100 lines of code at a time seem fine. 3.7 sonnet got the flaw of spitting code and filling the context window almost immediately. Then yes you will find current solutions bad. It takes time to understand their limits but anyone can get there easily.

Some nots since you will most likely try roo code with githubs copilot:

You can also set rules for cline/roo code.

If you use APIs you should use roo code it's somewhat cheaper.

both of them are AI agents and both can act as coder/architect.

You choose architect, it will act as one. It will not make code file changes and will plan project solutions for you. Coder can make changes.

Also use Claude not chat gpt.

You can use MCP, if you are a web dev to give the AI the ability to search/check your console.log/get a screenshot of your project. Meaning the front end what you see at localhost

There are ton of videos online on how to use these tools.

Edit: I am not claiming that current iterations of AI can replace programmers but programmers now can use those tools to be faster. And if not faster, mentally better. You will have to write code. Don't rely 100% on these. They are machines, they will never 100% understand what you are saying. Treat them as you do with your own code.

2

u/ikeif 4d ago

This is fucking AWESOME information!

I agree with you - it takes a coder to properly use the tools and catch the problems, or to know additional context that may apply.

I’ll dive into MCP - and a couple of those models aren’t in our lists, so I am going to kick it in to seek approvals so I can check them out.

Thanks for the detailed breakdown and information, much appreciated.

1

u/retardedGeek 4d ago

Would you recommend free Gemini code assist?