BTW, don't blindly trust what OpenAI says. I asked it a technical question, and the answer was totally wrong (albeit with perfect English).
It learns though. I challenged its response, citing a source that proved it was wrong. It apologized, and answered correctly the next time I asked the same question.
Based on the few interactions I've had with it, it's a natural language-polished source of raw data, without much "concern" about their accuracy or even correctness. Don't rely on it. Not yet anyway.
Apparently its really good at coming up with creative solutions to coding problems. The way it "thinks" about coding is uninhibited by traditional concepts of what commands can or should be used for what, allowing it to generate sleek, perfectly-functioning code.
Very nice, but here's an important question: is the resulting code generated by the AI itself, or is it just being pulled off some page on the internet, based on the real (human) programmer's description and how well it matches the query? In any case, how can one be sure that the code is bug-free? Also, is the AI engine capable of avoiding, detecting, and possibly correcting, bugs that are more complex than syntax errors or simple overflow/memory corruption cases? I'm talking generally here, and not specifically about the code you posted.
The possibilities of an AI generating efficient code that goes beyond conventional coding practices is very exciting, but I would avoid using the generated code in a copy/paste fashion. I'd prefer to have the AI check my own code, in case it can spot bugs I missed. But then, not everyone would want to send their own code to an AI.
Regardless of the above concerns, I'm sure we'll see significant and very exciting developments in the AI field.