GitHub Co-Pilot as a personal tutor
It just might be the get-out-of-tutorial-hell card we all need.
Tuesday, July 27, 2021
GitHub launched a technical preview of its pair programmer AI, Co-Pilot. Immediately after its launch, the loudest response from the tech community was, âYou really need to know your stuff in order to use it.â In other words, newbies need not apply.
I got my invite to join the testing community just under two weeks ago. Iâve used it daily ever since. And from what Iâve gathered, Co-Pilot is going to be a game changer in how people learn programming. In other words, newbies need to apply.
Strategic confusion
Itâs a decent strategy to use confusion as fuel for learning. Growth happens when weâre confused. When confusion hits, we try to sort it out. When too much confusion hits, we need feedback and directionâand these are not guaranteed. This means itâs very possible for confusion to become frustration. My best guess at the difference between fuel or frustration is this: Does it feel like it matters to work through the point of confusion?
Picture this: you have a project that youâre inspired to build. Your knowledge in a few of the technologies required is lacking. You could either:
- find a video or blog post that will walk you through an entirely different project, and hope it addresses the gaps in your knowledge,
- invest the time to read a book about it, or
- start writing what you know, and have some magical entity nudge you on what to write next.
The tutor/assistant/Fairy God-Co-Pilot
Part of a tutorâs job is to suggest something just beyond a studentâs scope of understanding, and while not perfect, Co-Pilot might be able to do just that. Co-Pilotâs suggestion is directly in the context of the project youâre working on. Actually, it makes ten suggestions. You could stumble upon a new array method, or a new structure like try/catch
in this way.
Read the other suggestions as you would read words in a thesaurus: similar overall, but with important and nuanced differences. As you read more code, youâll recognize patterns. Youâll come to understand those differencesâall because Co-Pilot showed you the right code snippets in the right context.
Whatâs wrong with the resources we already have?
How do you get better at writing? Read. But what if you were reading a book, and every now and then, your book switched languages or dialects? Thatâs what itâs like to read through JavaScript code. Different frameworks, different libraries, different modules show up. This makes it really frustrating for a newbie to browse through other peopleâs code for ideas and pointers.
Newbies are often encouraged to read documentation. Our current resources aim for correctness and completeness. They assume a certain baseline of prior knowledgeâwhich newbies donât yet have. Things arenât always presented in an organized or understandable way.
This is where Co-Pilot comes in: it uses other peopleâs code in training data to address your problem. It filters out any technologies youâre not using, until you decide to ask about them by importing them in. Co-Pilotâs suggestions are within the realm of being understood with a quick Google search. Theyâre new and usually varied enough to add to what you currently know.
Quirks
Co-Pilot is not great for staying up-to-date with what youâre learning. Since newer syntax hasnât been around as long as older syntax, thereâs a lot more older syntax in the training data code. This makes Co-Pilot suggest out-dated practices quite often.
Itâs really quick. It will jump in with its suggestions while youâre trying out an approach you thought up. While it doesnât over-write anything, I find itâs enough to make me lose my train of thought. I wouldnât mind a manual/concierge mode with a hot-key for requesting suggestions.
Iâve also seen code suggestions with comments in other human languages. This could be a real selling point, if only it was more reliable. Imagine if someone could ask Co-Pilot for suggestions with comments in their native tongue. That would be quite the dent in a huge barrier for so many people learning to code.
What if people use Co-Pilot on autopilot?
People can nod along politely while following webinars and tutorials without engaging with the topic. People can complete courses by copying and pasting the provided solution, instead of typing out the code themselves. And people can passively accept a Co-Pilot suggestion the second it pops up. As with any tool, itâs possible to misuse it.
Itâs also possible to make the most of it. Co-Pilot shows promise in helping people left behind by the learning resources we currently have. Itâs as if it assesses their skill level using the context of their code as a proxy. It meets them where they are stuck, and pulls them forward, one suggested code snippet at a time.
Thereâs always a way to skip over the learning. With Co-Pilot, we just might have a way to skip over the roadblocks.
Special thanks to Thomas Dillard for the careful proof-reading and sources below.