Posted in:

Git Hub Co-Pilot Is an AI Tool That Writes Code for You: Necessary or Overrated?

© by Unsplash

GitHub, in 2021, launched the most hyped product in the development world, an AI assistant to help you write code in every language. 

Co-pilot launched a beta program where users could try it for free for a certain period. And later that year, noticing the product’s success, GitHub launched the public version for 10 dollars a month.

There is no denying that it is a game-changer for development. If you haven’t used it, I highly recommend testing it out on their free trial to understand its potential.

GitHub co-pilot helps you in all programming languages. While it does have very good functionality only for a few languages like JavaScript and Python, it fairs well in all areas. 

It is more like a workhorse of coding that takes care of mundane jobs like syntaxes and writing basic code. Once the basic code is generated, you can dive in and write the unique logic behind it to make it functional.

How does GitHub co-pilot work?

GitHub co-pilot learns by studying the 100s of thousands of lines of code pushed daily to its platform. Thus, GitHub requires a lot of generated data before it can function. Languages like java script benefit heavily, as they’re hundreds of free repositories to study their source code. While it does work with all languages, the support is not that extensive, and its ability to generate code is minimal. 

GitHub Co-pilot is built on OpenAI’s Codex system. Open AI’s codex system is an AI system that was built to generate code based on natural language. You can test the product yourself with their API. 

Open AI looks forward to businesses and projects using their product and testing it out. Fundamentally, codex improves on its natural language system GPT-3, which further dives into generating code.

Git hub co-pilot analyses your files and provides you suggestions based on what it has read in your repository. This means that suggestions are based on your code, variable names, and syntax standards, leading to a smooth workflow.

Where it really shines

Co-pilot An AI code generator that caters to your personal needs. Here are the situations where it really shines, and you might find yourself addicted to using it.

1. Suggesting syntax

We all have been in that frustrating place where we must google basic syntax. This task is very distracting and can seriously affect your coding output. You don’t have to worry anymore, as GitHub co-pilot can save precious time with its suggestions. Suggesting syntax is one of the most powerful tools that it provides.

Going further than that, the co-pilot also writes down what you need. There are repetitive long syntaxes (useStates in react, solidity code for smart contracts), which can auto-generate using GitHub co-pilot.

2. Frontend HTML/JSX : 

Long divs and their structure can be difficult to write. With GitHub co-pilot, it is a breeze. It automatically generates the commonly used divs, suggests some CSS (although pretty bad), and helps name them appropriately.

 

With GitHub Copilot, you can reduce frontend development time significantly.

3. Customised to your project: 

You can find 100s of lines of code about a certain functionality on the Internet, but it would not cater to your personal project. Online code and guides will have different variable names, inundations, and other standards compared to your project. Luckily for you, the GitHub co-pilot amends the suggestions to fit perfectly with your project. 

Based on its suggestions, you will end up learning different approaches and solutions. But despite all the good, you should still check the code before using it. 

Necessary or Overrated?

Like any product, there are some issues with it. These issues in no way undermine the enormous features that it adds. But in an honest review, I have to include it.

  1. Janky interface: Based on your settings, there are many times that GitHub co-pilot becomes intrusive. It automatically suggests a lot of code that is sometimes hard to read, and with one “tab” key press, that code is sitting in your file, messing up your inundation. It does not abode well with existing IDE suggestions, and you will often delete extra closing brackets.
  2. Suggestions: While GitHub co-pilot does an excellent job of never suggesting code that breaks the code base, it sometimes suggests code whose functionality may not be possible based on your dependencies. Though it may happen a few times, it is not a game-breaker.
  3. Code quality: the overall quality of suggestions is subpar. You cannot trust that code. Instead, once the code is added, you often have to edit it to make it adhere to certain standards and add more redundancy and security to it. You can never truly trust it, and GitHub recommends not to do so.

Conclusion

Co-pilot has to be the most helpful and innovative technology for programmers and founders to come out this year. 

There is a lot of room for improvementbut the good news is that GitHub is dedicated to improving it. And in the last couple of months, the updates have improved it tenfold. As time passes and more functionality is added, it will definitely become more trustable and usable.

 

GitHub co-pilot has a bright future and may soon become an unavoidable tool.