this post was submitted on 14 Jul 2023
377 points (92.6% liked)

Programmer Humor

19623 readers
100 users here now

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

founded 1 year ago
MODERATORS
377
Finally (programming.dev)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 14 points 1 year ago (3 children)

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

[–] [email protected] 7 points 1 year ago (1 children)

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

[–] [email protected] 7 points 1 year ago* (last edited 1 year ago) (1 children)

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.

[–] [email protected] 4 points 1 year ago

And you know what you call changing words around to get a computer to do what you want? That's programming, baby! We are programming programmers!

[–] [email protected] 4 points 1 year ago

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.

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago)

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.