Settings

Theme

Ask HN: Have you got ChatGPT to output gibberish code?

1 points by firstfewshells 3 years ago · 5 comments · 1 min read


Or maybe even code that was syntactically incorrect?

ggeorgovassilis 3 years ago

No. It often produced code that referenced non existing packages or classes that conveniently would solve the problem if they only existed, but the code would otherwise compile.

weatherlite 3 years ago

Not gibberish but definitely I had quite a few back and forth where he would apologize for getting stuff incorrect, try to correct itself and sometimes be wrong again (in that case you can get into a loop where he alternates between two wrong answers). It was not gibberish just code that did not work (either at all or as intended) for various reasons. So I would call it buggy, not gibberish.

Worth noting it was ChatGPT 3.5 so maybe this is less of an issue now.

korotkevics 3 years ago

It helps to ask it to first split the implementation into a plan and then to ask to implement each step individually. Also, it is faster to fix tiny errors on your own instead of leading it into it. Sometimes it also helps to redo the full process with a good task definition and requirements list. The code isn't ideal but it could be more inspirational than an empty editor when starting something new.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection