Is GitHub Copilot a Threat to Developers?

Is GitHub Copilot a Threat to Developers?

by Hitesh Jethva

GitHub recently released Copilot to speed up your programming skills and accuracy. It is an AI pair programmer that assists you in writing code more quickly and efficiently. GitHub Copilot makes recommendations based on the context and style conventions of the project. Cycle through lines of code quickly, finish function suggestions, and decide which to accept, reject, or edit. GitHub Copilot is powered by Codex, and it is available as a Visual Studio Code, Neovim, and JetBrains integrated development environment extension (IDEs).

What are Github Copilot and AI Programmers for Everyone?

GitHub Copilot is an artificial intelligence (AI) tool developed by GitHub and OpenAI, an AI research laboratory. GitHub Copilot uses OpenAI Codex to suggest code and entire functions in real time from your editor. It has been trained on billions of lines of public code and converts natural language prompts, such as comments and method names, into coding suggestions in dozens of languages.

GitHub Copilot works directly in your editor with you, suggesting whole lines or entire functions.

1 GitHub Copilot, Your AI programmer

Copilot is designed to assist you in writing Python, JavaScript, TypeScript, Ruby, Go, C#, or C++ code. GitHub Copilot analyzes the context in the file you are editing and related files and makes recommendations from within your text editor.

GitHub Copilot requires a paid Subscription depending on your monthly or yearly package. These packages can be used by students and maintainers of popular open-source projects on GitHub. For more information About billing for GitHub Copilot

Below is the GitHub Copilot package, and you can subscribe.

GitHub Copilot packages

This brief article aims to summarize the evolution of abstraction layers in computer science to better understand the potential impact of GitHub Copilot.

Pros & Cons of Using GitHub Copilot

A virtual pair programmer who helps you save time and focus sounds fantastic, doesn't it? On the other hand, the GitHub Copilot did not receive a warm welcome. Let us look at the reasons for this.

Pros

  1. Repetitive code auto-fills: GitHub Copilot is excellent for quickly creating repetitive code patterns. You only need to provide a few examples, and Copilot will handle the rest.
  2. Alternatives are generated: Copilot will display a list of alternatives when you write a code line. You can select one of them or stick to your code if you believe it is superior. In any case, Copilot will learn and try to adapt to your preferences.
  3. It makes it easier to run tests with little effort: When you import a unit test package, GitHub Copilot will recommend tests that match your code.
  4. Speaks all of your favorite programming languages: Copilot understands many languages, including Python, TypeScript, JavaScript, Ruby, and Go. It can assist you in navigating almost any situation. Check out this link
  5. Write on your favorite Editor: Copilot integrates with your IDE tools directly into your editor, including Neovim, JetBrains, Visual Studio, and Visual Studio Code.

Cons

  1. Uncertainty in terms of quality: GitHub Copilot generates suggestions. However, it cannot test its code, so it may not even run or compile.
  2. Copyright issues are violated: According to GitHub, the suggestions may contain exactly from the training set 0.1% of the time. One of the major concerns about the Copilot is that it could infringe on intellectual property rights or launder open-source code into commercial use without proper licensing.
  3. It will not make you a good developer: This is similar to the two sides of coins. On the one hand, the tool will help you increase productivity and get recommendations to learn from. On the other hand, this is similar to copying and pasting from Stackoverflow.
  4. Dangerous to work with Copilot: Copilot is dangerous to new developers as it doesn't teach you how to code; it just codes for you to solve your issues.

Open Source Session Replay

_OpenReplay is an open-source, session replay suite that lets you see what users do on your web app, helping you troubleshoot issues faster. OpenReplay is self-hosted for full control over your data._

OpenReplay

Start enjoying your debugging experience - start using OpenReplay for free.

Is GitHub Copilot a Threat to Developers?

How much of a threat (if any at all) is it?

Can the Copilot replace the developers?

GitHub Copilot is an intriguing advancement in software engineering, even if it isn't entirely on point right now. According to the FAQ, the system gets the generation right about half the time, and it is advised to be cautious of the generated code. If we look at GitHub Copilot differently, we can see this as a new programming language. Using this input, the documentation and function names are translated into source code for another programming language.

Even if everything one day works seamlessly on a larger scale, the generated code will still require developers to handle the direction it takes and connect the bigger picture altogether.

Code problems

Because Copilot is trained on open-source code available on GitHub, the researchers hypothesize that the variable security quality stems from the nature of the community-provided code. "Because code frequently contains bugs, given the vast amount of checkout code that Copilot has processed, it is certain that the language model has learned from exploitable, buggy code."

This means that GitHub Copilot was trained on unfiltered sets of repositories that may have contained unsecured coding patterns. Whoever approved training Copilot on such repositories is probably regretting their decision now.

Why Copilot writes bad code

In short, GitHub Copilot has adopted the bad habits of human developers. And, because there is no peer review, buggy code may be accepted in some cases. "Generally, Copilot should be paired with proper security-awareness tools throughout both training and generation to reducee the risk of introducing security vulnerabilities," the researchers concluded.

Problems with auto-generated code

Copilot generates code based on the description provided by human developers. It can also predict the following line of code from hints such as variable and function names. It is not the same as autocompletion; its function is more interpretive.

However, GitHub stated on its official blog that Copilot is trained on public code, which may contain insecure coding patterns, bugs, or outdated code API references; the tool can also regenerate code that contains similar patterns.

Cognitive Bias and AI Pair programming

An AI pair programmer must be able to collaborate effectively with humans. Likewise, vice versa. On the other hand, humans have two cognitive biases that make this difficult: automation bias and anchoring bias. Because of this pair of human flaws, we tend to over-rely on Copilot's suggestions, even if we try not to.

When we type into visual studio code, Copilot jumps in and suggests code completions entirely automatically and without our intervention. That often means that Copilot has already plotted a route for us before we have had a chance to think about it. This is not only the "first piece of information" we're receiving, but it's also an example of "suggestions from automated decision-making systems" - we are getting a double dose of cognitive biases to overcome! And it doesn't happen just once, but every time we type a few more words in our text editor.

So GitHub can't simply fix this by carefully presenting Copilot recommendations and educating users.

In unfamiliar territory, code with confidence

While learning a new language or just getting started with coding, GitHub Copilot can help you find your way without constantly searching the Internet for answers. GitHub Copilot learns how you write code and can auto-complete a code snippet or an entire function. In this way, Copilot lets you quickly discover alternative ways to solve programming problems.

Conclusion

GitHub Copilot will usher in many changes in the industry, but the extent to which those changes will be beneficial or detrimental is unknown. Today, GitHub Copilot is not a threat to developers various that have been present. But over a generation of time, it will keep becoming better.

GitHub Copilot generates code from the public GitHub repository while you are working with your favorite editors, and as far as my concerns, Copilot is an excellent tool like a compiler... but due to its working nature, it will threaten developers around the world.

A TIP FROM THE EDITOR: If you want to use Copilot with Visual Studio Code, check out our Top Visual Studio Code Extensions For Developers In 2022 article for more on that.

newsletter