←back to thread

371 points ulrischa | 1 comments | | HN request time: 0s | source
Show context
tombert ◴[] No.43235669[source]
I use ChatGPT to generate code a lot, and it's certainly useful, but it has given me issues that are not obvious.

For example, I had it generate some C code to be used with ZeroMQ a few months ago. The code looked absolutely fine, and it mostly worked fine, but it made a mistake with its memory allocation stuff that caused it to segfault sometimes, and corrupt memory other times.

Fortunately, this was such a small project and I already know how to write code, so it wasn't too hard for me to find and fix, though I am slightly concerned that some people are copypasting large swaths of code from ChatGPT that looks mostly fine but hides subtle bugs.

replies(2): >>43235969 #>>43238803 #
zahlman ◴[] No.43238803[source]
>though I am slightly concerned that some people are copypasting large swaths of code from ChatGPT that looks mostly fine but hides subtle bugs.

They used to do the same with Stack Overflow. But now it's more dangerous, because the code can be "subtly wrong in ways the user can't fathom" to order.

replies(2): >>43244928 #>>43245641 #
1. krupan ◴[] No.43245641[source]
The beauty of stack overflow is that the code you are copying and pasting has been reviewed and voted on by a decent number of other programmers