Technology

GitHub’s new AI tool can give suggestions to help write better code


GitHub Copilot can draw context from a programmer’s codes and comments, and suggest them individual lines and entire functions swiftly.

GitHub has previewed a new artificial intelligence (AI) tool that can give suggestions to people while coding and help them write better code with less work. It was developed in collaboration with the San Francisco-based AI research company OpenAI.

(Subscribe to our Today’s Cache newsletter for a quick snapshot of top 5 tech stories. Click here to subscribe for free.)

GitHub Copilot can draw context from a programmer’s codes and comments, and suggest them individual lines and entire functions swiftly, the firm noted.

“It helps you quickly discover alternative ways to solve problems, write tests, and explore new APIs without having to tediously tailor a search for answers on the internet,” GitHub CEO Nat Friedman said in a blog post. “As you type, it adapts to the way you write code—to help you complete your work faster.”

As the name Copilot indicates, the tool is designed to work with a programmer and not independently, and can be used when working in a new language or framework, or while learning to code. Besides, the code suggestions from the tool can be accepted, rejected, and even manually edited by a programmer.

Also Read | Must we always talk in code? No-code and low-code platforms are changing devs discourse

Some of the samples on GitHub’s website show the tool generating code to fetch tweets, get a Goodreads rating, and draw a scatterplot. Copilot works with a broad set of frameworks and languages, however, the technical preview does especially well for Python, JavaScript, TypeScript, Ruby, and Go, according to GitHub.

The Microsoft-owned firm noted that OpenAI’s system powering its tool was trained on a selection of publicly available source code, as well as natural language. “OpenAI Codex has broad knowledge of how people use code and is significantly more capable than GPT-3 in code generation,” Friedman said.

OpenAI’s GPT-3 language model, uses deep learning methods to create human-like text in real-time, and Microsoft received an exclusive license to use the model in its products and services last year.

GitHub Copilot is available as a Visual Studio Code extension. The Copilot editor extension sends comments and code to the GitHub Copilot service, which then uses OpenAI Codex to synthesise and offer suggestions to the user, the company explained.

“Trying to code in an unfamiliar language by googling everything is like navigating a foreign country with just a phrasebook. Using GitHub Copilot is like hiring an interpreter,” Harri Edwards, Research Scientist at OpenAI, said in a blog post.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button