Is ChatGPT any good at writing code?
No. It can write some basic code (like examples from some book) compiled from his database, but if you're needs to do something specific, you won't get working code from it.
ChatGPT has some fundamental problem which prevent it to solve some issue in his code. So, if first sample code compiled from his database is not enough for you, you can't get something else. It just will propose the same code for any your request to change or fix something in his code. From this point of view, it seems to be programmed to use the broken record technique.
In short, it often provide you with a wrong or mistaken code (which at a glance looks good, but when you analyze it you will found issue) and when you're asking to fix it, it just repeat that code again and again with keeping issue in the code. And there is no way to learn it to solve it.
While yes, it's better at basic tasks it's seen before, it can also synthesize those basic tasks together into something bigger.
I've had ChatGPT create basic python GUIs in tkinter based on a description of the layout and functionality I gave it as text in the prompt. There was no way it had ever seen that exact layout and code before, but it got it working after a reasonable amount of bug fixes.
A buddy was telling me about a new LLM that writes code (sorry, forgot what he said it was exactly). It actually runs the code in it's own sandbox and debugs it itself on the fly. Pretty cool.