Is code completion bad for learning?
No, not normally with other code completion tools. If the completion UI shows a list of functions or methods, with documentation, or shows previously-used variables, or shows types available, etc etc, that’s really useful and can really help.
But in this case, with Copilot , yes it is bad for learning, a million times yes [though obviously YMMV].
Copilot isn’t a code evaluation tool or a debugging tool. It’s a smart completion tool. You aren’t really going to learn, it’s just going to do the entire curriculum for you. You’re really just learning what hints you should give to an algorithm so that it produces output that passes some tests. That’s all.
It works based on a corpus, and that corpus has hundreds (if not thousands) of correct examples of code for these challenges, because people put that stuff in GitHub. So as soon as you start typing something that matches any of those examples, you’ll get the rest filled in immediately. That’s kinda useful IRL – it’ll fill in simple stuff and boilerplate without any problem whatsoever. That’s pretty good for things like unit tests! It’s also kinda not useful – it won’t do business-specific logic (which is most useful stuff IRL) very well. It’ll often get quite close, but quite close isn’t great because it actually increases the amount of manual fiddling needed to make things work properly (it generates heaps of code where everything looks fine at first glance). If you know what you’re doing and you know what you’re looking for, that’s sometimes ok, if annoying. If you don’t, which is where you’re at, then you’re just guessing, it’s just trial and error.
It is a very useful tool at times, but you need to be very careful with it and understand what it is. If you have basic needs (eg you are following a beginner curriculum & you want it to give you the answers!) it will probably be able to write the code for you. If you are very careful about how you structure your code and give it very specific hints, you can get it to write quite complex things. But without a base knowledge of how code works, you are just hoping that the [very dumb!] machine will write things that fulfil the tasks you’ve been given, and that it won’t mess things up.
If you get someone/something else to do the work of learning for you, then it’s unlikely you’re going to learn anything. To get information into your brain, to learn these skills, you normally need to do it yourself, to write code. It’s the process of writing it that gets it stuck in your head, not looking at code that’s already been written. Like writing notes: it’s not the notes themselves, it’s the process of writing the notes that’s the important bit.