No. They didn't code very well back then, they just pattern matched and regurgitated whatever code snippet was in some GitHub repo that matched your prompt best. And that's what they're doing now, too.
They're useful tools when used intelligently, and they can have their moments of surprising utility, but by an large they're like really fancy boilerplate generators but with far less accuracy and reliability.