You are viewing a single thread.
View all comments
31 points

Most of the codes I copied from GPT doesn’t even work Seems I spent more time fixing it compared to thinking it myself

permalink
report
reply
44 points

Seems I spent more time fixing it compared to thinking it myself

AI code is just bad code written by someone else that I now have to fix, and we all know the one job every coder loves is fixing code written by someone who you cannot ask: “why did you do it this way?”

permalink
report
parent
reply
6 points

You can definitely ask… It’s just the answer might infuriate you even more

permalink
report
parent
reply
3 points

INSUFFICIENT DATA FOR MEANINGFUL ANSWER

permalink
report
parent
reply
1 point

It can be helpful though if you just need to find the right library function of proper syntax in a foreign language. Usually faster than a search

permalink
report
parent
reply
14 points

Often when I tell ChatGPT what error its code produced it will immediately figure out what the bug was and fix it.

permalink
report
parent
reply
7 points

interacting with chatgpt is a learned skill

i’ve used it several times and while the initial code may have some issues you can get them cleared up with a few direct follow ups

permalink
report
parent
reply
7 points
*

I recall reading a while back of one person’s strategy, whenever ChatGPT generates code for him he immediately tells ChatGPT “there’s a bug in that code” (without checking or specifying). It’ll often find one.

Another approach I’ve heard of is to tell ChatGPT that it’s supposed to roleplay two roles when generating code, a programmer and a code reviewer. The code reviewer tidies up the initial code and fixes bugs.

Since often ChatGPT’s code works fine for me I don’t usually bother with these steps initially, since I’m usually just wanting a quick and dirty script for a one-off task the quality doesn’t matter much in my case.

permalink
report
parent
reply
4 points

Yeah, this is the way how to interact with it. It makes sense as well, because it’s only predicting the next word based on the previous words, so it had can in hindsight find a lot more stuff and in general be smarter about it.

permalink
report
parent
reply
3 points
*

I do this with TypeScript error codes. It’s great at breaking down the problem. I never just copy paste code from it and I don’t think anyone should do that anyway.

permalink
report
parent
reply
10 points

The art is the same. AI is just like asking an art student to draw you a picture. Might be good, might look terrible. Don’t ask for hands.

permalink
report
parent
reply
6 points

Don’t ask for hands.

or feet.

or animals.

or eyes.

or…

permalink
report
parent
reply
2 points

I’ve never had an issue with it personally but I’ve never asked it to do anything complex either

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 7.2K

    Monthly active users

  • 954

    Posts

  • 36K

    Comments