Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> But AI code generation is garbage,

"create an express server that uses CORS to only accept requests from <mydomain> that has 3 async endpoints defined, 2 GET endpoints titled <a, b> and 1 POST enndpoint titled <c>. The POST endpoint should accept JSON, and the GET endpoints will return JSON. Stub out the route handlers, they will be defined in another file. For the POST endpoint parse out the userId from <header field> and also pass it in along with the JSON"

"Here is a typescript definition of the JSON being posted to this endpoint, validate all string fields are less than 100 characters long, and that none of the values are null, then write the data to a redis DB at <location> using auth values already loaded up in the environment. Data should be written to <userid/location>"

"Now add exception and error handling around this code, cover the following case: Data is invalid - Return an error message to the user with HTTP error code 400, Redis is not accessible - HTTP 500. Also log errors using the <logging library> that has already been imported and initialized up above, and increment an appropriately named counter using the <analytics library> that is also already imported and initialized."

If you are getting garbage AI code, you are not using proper tools. If you just go to ChatGPT and ask it for stuff, you won't get very good code (and IMHO GPT4o is much worse at coding).

Use a proper editor that prompt engineers code generation (such as Cursor), and LLMs can write some really good code.

Can it end to end generate an entire service with just a vague description? No. But it can easily 2x-4x development speed. Heck I've thrown code at GPT4 and asked it to "please look for common concurrency bugs that may have been overlooked in this code" and watched as GPT4 saved me literal hours of debugging.

What OpenAI has is a problem monetizing the value their product brings, since the value to each customer is so different. When I'm at home, I'm happy to pay $15 a month in API usage fees to accelerate my coding, but a company should be happy to pay hundreds of dollars per month to accelerate the speed code is written. Figure $100 an hour average cost for a dev on the east or west coast of the USA, if GPT4 saves 10 hours a month (easy!) then OpenAI should be charging at least $200-$500 a seat licenses per month.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: