We are going to explain to you what it is and how it works GitHub Copilot, an artificial intelligence system that is causing a revolution for programmers. It is an AI that is a close relative of ChatGPT, although focused on making programming suggestions.
We are going to start the article by explaining what exactly Copilot is, because it does not generate code from your requests but from what you have written. And then, we will explain how it works, all in an easy to understand way so that even if you are not a developer you can understand its operation in a basic way.
What is GitHub Copilot
Copilot is a help system created by GitHub, which is one of the largest portals in the world to host open source Applications. It is a portal that was bought by Microsoft in June 2018, and in which hundreds of thousands of developers upload their code, their applications and their tools so that it is open to anyone who wants to review it or collaborate in its development.
For his part, Copilot is an assistant based on Artificial Intelligence It helps to write code in real time. GitHub started showing this system in mid-2021, and has gradually developed and improved it.
What this wizard does is suggest code to continue completing a program that you are developing To do this, Copilot uses what you’ve written so far to “guess” what you’re going to do next. The developers who tried it from its beginnings already described it as spectacular and very interesting.
Copilot is based on Codex, which is a new artificial intelligence system created by OpenAI. This is the same organization that has created the GPT-3 engine on which ChatGPT and ChatGPT Plus or Bing Chat are based. Like them, Copilot also works in Spanish.
Therefore, we can say that it is a close relative of ChatGPT, but that focuses specifically on code creation, since he has been trained for it. For its part, Codex works in a very similar way to GPT-3, being able to understand the meaning of the context that we offer through our code, and then synthesize new code from it.
In the short time it has been running, Copilot has been used by 1.2 million developers, and it has achieved very good figures, such as 40% of its suggestions in languages like Python being accepted by developers. Copilot generates brand new code from scratch, and doesn’t copy the one already on GitHub, although some of the free code was used to train it.
Github Copilot is a paid tool, which costs $10 per month or $100 per year for independent developers, or $19 per user per month for companies, although in both cases with a free trial. Besides, integrates directly into various code editors Top tier ones like Neovim, JetBrains IDEs, Visual Studio, and Visual Studio Code.
Finally, it must be said that Copilot is an AI still almost newborn, so it still has a lot of room for improvement. It is true that in Python its hits are very high, but its generated or autocompletion codes still have bugs, and GitHub will continue to improve it. But even with these bugs, it still offers very good code structures that you can use.
How GitHub Copilot works
Copilot’s operation is relatively simple. You are a developer, and you open your compatible code creation tool and start writing the code for your program. Copilot will understand everything you writeand it will use that code that you are creating.
You will use it to understand the context of what you are doing, to be able to understand the type of program you are creating and what you want to achieve with it. So when we can the AI will suggest code hints based on everything you’ve written and how these codes tend to be completed with the public text hosted on GitHub.
Come on, it’s like the AI knew how to program thanks to knowing how the code is developed and written on GitHub. And then, based on what you’ve written, it will be able to generate entirely new suggestions for you to complete your code from scratch.
When it makes suggestions, you can accept the code to autocomplete in the editor, or say no to make different suggestions based on your response. With that, Copilot can take many hours of work from you generating code that is usually tedious and repetitive to write by hand.