GitHub Copilot AI Lets Developers Take A Back Seat As The Machine Writes Its Own Code
I have only dabbled in programming, and from my limited experience, I can appreciate that really good coding is an art form that not everyone possesses. Whether I have it or not, I can't say—I've never dived too deeply into programming to find out. If I ever do, Microsoft's new GitHub Copilot might prove to be a boon.
What exactly is Copilot? It is an AI pair programmer that helps coders hammer out lines and functions faster and with less work, especially with the more mundane stuff. Developed in collaboration with OpenAI, an AI researcher company co-founded by Elon Musk and backed by Microsoft (by way of a $1 billion investment
in 2019), Copilot taps into the power of artificial intelligence to help write code.
It is based on OpenAI
Codex and trained on billions of lines of publicly available source code, and also natural language. It does not have the capability to write perfect code (if such a thing exists), but it understands different programming languages as well as human languages, and adapts to your coding style, suggesting individual lines and whole functions as you program.
"GitHub Copilot understands significantly more context than most code assistants. So, whether it’s in a docstring, comment, function name, or the code itself, GitHub Copilot uses the context you’ve provided and synthesizes code to match. Together with OpenAI, we’re designing GitHub Copilot to get smarter at producing safe and effective code as developers use it," Microsoft explains.
The new GitHub Copilot service
It can also show a list of alternative coding solutions, based on what you are trying to accomplish. Programmers can choose to accept, reject, or manually edit those suggestions, and as time goes on, Copilot is supposed to adapt to the edits that have been made. Does it work well, though? Microsoft claims it does.
"We recently benchmarked against a set of Python functions that have good test coverage in open source repos. We blanked out the function bodies and asked GitHub Copilot to fill them in. The model got this right 43 percent of the time on the first try, and 57 percent of the time when allowed 10 attempts. And it’s getting smarter all the time," Microsoft says.
One thing to note is that Copilot does not actually test the code it generates and suggests, so the output might not compile or run. It is also works with limited context—a few hundred lines at a time. So it is a copilot that is not yet ready to fly solo, but can potentially help you navigate the programming skies.
"While we are working hard to make GitHub Copilot better, code suggested by GitHub Copilot should be carefully tested, reviewed, and vetted, like any other code. As the developer, you are always in charge," Microsoft says.
Still, this is impressive stuff, and it is based on "start-of-the-art AI hardware." Anyone interested in kicking the tires can sign up to join the wait-list for a technical preview within the Visual Studio Code editor.