A "co-pilot" is commonly known as the second driver, literally, which means someone else has control or access to whatever you're driving or doing... I like to think of him as a helper, a second hand that helps you guide and allows you to reach your destination or achieve your goal. Now speaking of GitHub Copilot, this tool helps you a lot by intelligently predicting your code and adapting to what you want to code. In this blog we will give you a quick intro on how to install, test and use it to the fullest!
But before we get started we'd like to point out that we don't recommend using Copilot to write complete code, but learning how to use it to understand the limits of the assistant and all the ways it can help you code.
First you'll have to join the GitHub Copilot waitlist, you can do that by clicking here.
Now, according to their website GitHub Copilot is powered by Codex, the new AI system created by OpenAI. GitHub Copilot understands significantly more context than most code wizards. So, whether it's in a docstring, comment, function name, or the code itself, GitHub Copilot uses the context you provided and synthesizes the code to match. Together with OpenAI, we're designing GitHub Copilot to be smarter at producing safe and effective code as developers use it.
The main goal of GitHub Copilot is to save your time and also help you stay focused by putting the knowledge you need with its trained lines of billions of public codes.
You can also enjoy the following benefits with GitHub Copilot:
- Your Editor Extends:
You can use the GitHub Copilot extension on your desktop or in the cloud on GitHub Codespaces since it’s fast enough to use as you type. The extension is available for Neovim, JetBrains, and Visual Studio Code.
- Speaks any language you like:
- You're the one in control, always!
You're always gonna be in charge, after all, YOU ARE the pilot!
But of course, you can cycle through alternative suggestions, choose which to accept or reject, and manually edit the suggested code. It adapts flawlessly to the edits you make, matching your coding style.
A quick guide on how you can use to the fullest GitHub Copilot:
- It helps you autofill repetitive code:
Works great for quickly producing boilerplate and repetitive code patterns. To start you can show it a few examples and let it generate the rest for you!
- Effortless tests:
As you may already know, tests are the backbone of any robust software engineering project! Sometimes the most anxiety giving part of any project! You can import a unit test package, and let GitHub Copilot suggest tests that match your implementation code.
- Alternative ways...
If you ever want to evaluate a few different approaches you can do so with GitHub Copilot can show you a list of solutions. To do so you can use the code as provided, or edit it to meet your needs and explore your options and different ways.
- Comments = code:
You can write a comment describing the logic you want, and let GitHub Copilot assemble the code for you. How awesome is that?
- Name functions = code:
Same as above, you can name a function for example getStringInitials, and your AI pair, suggest the code for the function in the language which you are working.
There's no fear with GitHub Copilot, whether you're working with a new language, coding normally, or learning to code, Copilot helps you find your way without getting in the way of your learning or professional growth.
You will be able to solve each error and learn new ways to do it, you will learn to use new languages in a simpler way without having to search or stress yourself looking for ways or hacks on the web!
We hope you have a good experience with GitHub Copilot and that this little guide helps you feel more comfortable to try it and use it from now on!