3 ms·
> You're getting hung up on details of code written by ChatGPT, you do realize that, right? I'm getting hung up on what the author chose to publish. The auth
by mrkeen 3y ago
> You're getting hung up on details of code written by ChatGPT, you do realize that, right?
I'm getting hung up on what the author chose to publish.
The author asked,
>> do you want to know when something bad can happen in your program, or don’t you?
and then published some Python code and some Go code. Of the Go code he wrote:
>> Wouldn’t you know it, we have all the aforementioned errors handled!"
It's not some subtle gotcha, it's the point of the article and he somehow managed to demonstrate the opposite.
It would be like switching from garbage collection to C to make sure you remember to free all your mallocs, then showing demo code that's only a singular line change away from returning all its memory.
- pdimitar 3y agoI still maintain that this code is one line of fix away to satisfy your requirement of a proper OS exit code, which you didn't address in your comment. And readability. It's quite subjective and I can work with both the Python add Golang errors.