A new "AI pair programmer" represents a breakthrough in the third revolution of software development: the use of AI in coding.
Microsoft and OpenAI have collaborated to build an AI pair-programming system called GitHub Copilot. Copilot, now available in preview as a Visual Studio Code extension, is meant to help programmers write code faster and with less work, Microsoft officials said on June 29.
Copilot is powered by OpenAI Codex, a new AI system. Microsoft and OpenAI have been working together for the past few years on various projects; Copilot is their latest collaboration.
"If the technical preview is successful, our plan is to build a commercial version of GitHub Copilot in the future. We want to use the preview to learn how people use GitHub Copilot and what it takes to operate it at scale," GitHub officials said in a frequently asked questions (FAQ) document published today.
Since GitHub Copilot is available as a Visual Studio Code extension, working wherever Visual Studio Code works, on the developer’s machine or in the cloud on GitHub Codespaces. With access currently limited to a small group of testers, persons interested in trying Copilot can sign up for the Copilot waiting list.
Codex was trained on billions of publicly available source code lines -- including code in public repositories on GitHub -- and on natural language, which means it can understand both programming and human languages. The Copilot editor extension sends comments and code to the Copilot service. The service uses OpenAI Codex to synthesize and then suggest both individual lines of code and whole functions, Microsoft officials explained in the FAQ.
Copilot is meant to try to discern intent and generate the best code it can. However, it doesn't test the code it suggests, and Microsoft cautions that it may suggest old or deprecated uses of libraries and languages.
Copilot is meant to improve with time and use. Microsoft advises developers to divide their code into small functions, use meaningful names for functions parameters and write good docstrings and comments as they go. They also said Copilot "seems to do best when it's helping you navigate unfamiliar libraries or frameworks."