I'm super happy that people share stuff like this to discredit AI and say that it doesn't help with code.
And then I correct it and say "hey yeah there's two Ls in a row" and it apologises for its mistake and gives me perfect code.
Yeah it can't give you perfectly working code 100% of the time for every single thing, first time. What it can do is can get you 75% of the way, and then get to 99% with a short conversation.
The issue I mostly have that it then corrects the error I pointed out but introduces a new one. I then point out the new error and it reintroduces the old one.
But overall still very helpful, so helpful actually that I actually pay for Plus. Web Plugin is awesome for quickly searching trough documentation.
I wouldn't say I'm discrediting it, given that I use it on a regular basis.
But I have seen companies choose the generative mess from ChatGPT over actually experienced devs or writers, that too the first response. They won't even correct it, because they won't even read it fully.
I know it sounds like a rare occurrence, but boy oh boy do I have news for you.
Most times it works like that but sometimes it gets stubborn and can't give me a correct answer, try asking the AI for something like: which variables are unused in this code:
...
I knew at least some were unused but chatgpt refused to acknowledge so, until it did but also included a bunch of other variables that were used.