GitHub Copilot High-Level Overview
Table of contents
- What is GitHub Copilot?
- What can GitHub Copilot help with?
- What are the limitations of GitHub Copilot?
- What is GitHub Copilot Chat?
- Final thoughts
What is GitHub Copilot?
GitHub Copilot is an artificial intelligence tool that attempts to speed up the process of coding by generating snippets of code while typing. It is essentially a super-powered code completion tool.
Traditional code completion tools provide limited assistance by suggesting names of classes, functions and variables, and generating code using built-in templates. GitHub Copilot takes code completion to the next level by offering suggestions for generating comments, multiple lines of code, and whole functions.
What can GitHub Copilot help with?
GitHub Copilot is very good with solving tedious and mundane tasks. It is especially useful when working with syntax or details that are not necessary complex but nevertheless hard for human to remember. Here are examples of tasks that GitHub Copilot is really good dealing with:
- Generating validation code and parsing code using regular expressions,
- Generating CRON expressions,
- Working with CSS syntax,
- Generating test data,
- Generating simple unit tests,
- Learning a syntax of an unfamiliar programming language.
What are the limitations of GitHub Copilot?
- GitHub Copilot has a limited context.
Behind the scenes GitHub Copilot uses now-famous GPT large language model. This model has a limited input size and cannot fit all code of a typical software project. As a result of this limitation the tool does not really know about all code that is included into a project. In order to generate suggestions GitHub Copilot creates a context, which includes only snippets of code from a current file above and below the cursor and files opened in an IDE.
So in order to prevent hindering GitHub Copilot’s capabilities, it is important to keep files small and keep opened only those files that are related to the your current task. As you can see, multitasking is can be detrimental not only for human but even for AI. - GitHub Copilot has no understanding of language syntax. GitHub Copilot is not a compiler. While it can generate good code, it does not check the code for correctness. Generated code may not compile or may generate errors at runtime. So do not throw away your IDE yet, you still need to rely on it to help with checking the generated code.
- GitHub Copilot does not import libraries and add dependencies.
While other tools that provide code completion also have the ability to automatically import libraries and add dependencies, GitHub Copilot cannot do any of these tasks. It can only generate the code. - GitHub Copilot does not support less popular programming languages. GitHub Copilot was trained using publicly available source code. This made it really good with mainstream programming languages such as Python, JavaScript, TypeScript, Ruby, Go, C# and C++. When using less popular programming languages, however, GitHub Copilot will be much less helpful simply because there is not enough source code available in these languages to learn from.
What is GitHub Copilot Chat?
GitHub Copilot Chat is a new chat-bot that integrates into IDE and knows about code of your project. It has the same limitations as GitHub Copilot and offers a few extra features allowing to:
- Analyze and explain code, and answer questions about the code,
- Generate unit tests for a selected function,
- Fix syntax errors,
- Fix bugs.
Unfortunately at this moment, GitHub Copilot Chat is not available to the general public and only available through a private beta channel.
Final thoughts
Using GitHub Copilot feels like having another software engineer who is always ready to help with boring tasks. Sometimes this engineer offers wrong answers and does not understand what you are working on but overall having AI assistant improves coding experience. At the same time it does not feel like it is a mind blowing revolution that allows software engineers to finish work 10 times faster. Sorry management. It is helpful, but not so helpful that you cannot live without it.
GitHub Copilot requires a paid subscription that starts from $10/month or $100/year. If the price of this tool is not a concern, we definitely recommend enabling GitHub Copilot in your IDE since it does not get in your way even when it offers wrong suggestions.