GitHub Copilot: Programmer’s Assistant?
GitHub released an AI-based coding assistant for Visual Studio Code called Copilot. Copilot is the result of Github’s collaboration with OpenAI. GitHub Copilot performs context analysis of developer code to suggest entire lines or functions and help programmers to find alternative solutions to a problem.
Copilot adapts to the way users write code and can get the job done faster. GitHub Copilot is based on the OpenAI Codex model. This model trains billions of public code and text on the Internet.
Codex has several criteria in filtering files, including the following:
- Has the possibility of being auto-generated.
- Has an average line length of more than 100.
- Maximum line length more than 1000.
- Has a small percentage of alphanumeric characters.
After the filtering process, Codex has 159GB of dataset for GitHub Copilot development. Here, Copilot can see patterns from code written by programmers. Copilot will understand what the programmer wants to write in the next line.
GitHub Copilot can support multiple programming languages including Python, JavaScript, TypeScript, Ruby, and Go. GitHub Copilot can also support Neovim and JetBrains IDEs, which focus on the latest versions of IntelliJ IDEA and PyCharm. GitHub Copilot has also added support for multiline completion in Java.
GitHub Copilot Features and Capabilities
- Convert Comments to CodeGitHub Copilot can understand comments and function names. All you do is write a comment explaining the need and the logic you want for your function. Then, GitHub Copilot will generate the code for you.
- Tests without the ToilTesting is the fundamental of any software engineering project. You need to import a unit test package, then Copilot suggests tests that match the implementation code.
- Autofill for Repetitive CodeCopilot can also autofill repetitive code, making the programmer’s job more efficient. You only need to write the initial code, then Github Copilot will automatically pass the code.
- Show AlternativesEvery programmer has a different approach or method when writing a code. Copilot has a feature that allows the user to view several approach options. Users can also use the suggested code or change it as needed.