What an AI do is making up something to respond to you, it doesn't care for performance, security or correctness of the logic behind it, sometimes it even imagine libraries that don't exists.
You can surely learn to code, once you get your hands on it you'll understand it's not magical.
What you can do with an AI that can be actually helpful is learn to "think" like a programmer, you can ask how to break down a problem and you can let it review "real code" to get a description of how it was made and also check if what you've done is correct or not.
But never let it write your code, if you look around you'll see that it won't go farther than simple snippets most of the time.