GitHub chat Copilot: coding will never be the same

GitHub chat Copilot: coding will never be the same

Coding will never be the same, with AI-powered suggestions that help you write code faster and more accurately

In this blog, we will see the capabilities of GitHub Chat Copilot which is still in beta test as I am writing this article (September 2023).

What is GitHub Copilot?

Let's start by defining GitHub Copilot which is the global component.

GitHub copilot is an artificial intelligence tool developed by GitHub and trained on billions of lines of code to assist developers during their coding process.

It provides assistance by suggesting code directly in the editor in relation to the project context.

What is GitHub Copilot Chat?

GitHub Copilot Chat is a feature of GitHub Copilot (in beta test as I am writing this article) that provides a chat interface directly integrated into the IDE which allows you to answer certain questions about development, explain a code snippet, or suggest a bug correction.

You can see that in addition to the automatic code suggestion offered by GitHub Copilot, the chat feature offers an interface designed to answer code questions without having to change windows, which helps boost your productivity.

In short, it's like a Chat GPT / Bard / Bing Chat directly integrated into your code editor :)

As you can see in the following screenshot the copilot chat was able to detect the error in the selected code.

Let's test now

Finally, here we go!

We will subdivide the tests into five categories which are obviously not exhaustive of the exceptional capabilities of Chat Copilot:

  • Code generation

  • The code explanation

  • The bug fix proposal

  • Answers to questions about code

  • The translation

Code generation

Like GitHub copilot, the chat feature allows you to automatically generate snippets of code based on your request.

Here, we ask Copilot to generate a method that allows us to check if an employee ID is valid by specifying our way of identifying employees, in just a few seconds it provides us with an almost perfect result😊.

The code explanation

Chat copilot is able to explain some code snippets, you just have to ask him.

Here we simply did the opposite operation by asking our friend Copilot to explain to us the piece of code generated previously.

The proposal for bug fixes

Chat Copilot can detect errors in the code and even suggest a solution.

It managed to detect that I had incorrectly noted the lastName variable and directly suggested how this error could be fixed.

It is possible to paste the suggested code by Copilot in our editor in just one click.

It’s done, we have no more errors 😍

Answers to questions about code

In the same way, you can ask your coding questions to Chat GPT, Bing AI, Bard, and others; you can also do the same with Chat Copilot but this time you won't even need to leave your code editor window :).

We asked how to integrate an SVG image in Flutter and it obviously tells us what is necessary to know.

The translation

imagine you have a very large application with a language file and you want to translate it into 5 different languages; well you can do that with Copilot chat in no time.

Imagine all the time you will be able to save...

Limitations

Even if Chat Copilot can do extraordinary things that we would never have thought possible a few years ago, it cannot do everything and has several limitations, I will list 3 of them.

Security

Copilot has been trained on billions of lines of open-source code, some of which are unreliable, so it is possible that it generates snippets of code containing security vulnerabilities; it is up to you to carefully check the quality of the generated code before using it.

Generating inaccurate codes

This limitation is similar to the previous one, you should definitely not fully trust Copilot Chat, it is possible that it generates code that does not work at all, and you should always carry out in-depth tests on the generated code.

Copilot has been trained to solve problems or answer questions related to programming; If you want to know if we really went to the moon, you shouldn't ask Chat Copilot for that 😄.

Conclusion

Artificial intelligence is changing the way we work and programming is not exempt from this, so it is important to know how to use AI tools to stay competitive in the market.

Even though GitHub Chat Copilot is able to do amazing things, it can't do everything, so you need to know when to use Copilot because in some cases a simple search on Google would save you time rather than Copilot.

Currently (September 2023) GitHub Chat Copilot is available in public beta testing for users with a GitHub Copilot subscription, for more details click here.

References

https://docs.github.com/en/copilot/github-copilot-chat/about-github-copilot-chat

https://www.freethink.com/robots-ai/github-copilot?source=post_page-----74fd4196e985--------------------------------