Github Copilot, your best friend

Wouter van der Meulen
Wouter van der Meulen
Oct 14 2022
Posted in Engineering & Technology

How GitHub Copilot can help you write better code, faster.

Github Copilot, your best friend

What is GitHub Copilot?

Github Copilot is an AI-powered code generator that helps you out by trying to autocomplete your code. It's a new feature that GitHub rolled out a while ago in beta, but it's now available publicly as a subscription service. Copilot essentially functions as a Visual Studio code extension that works alongside the normal autocomplete features.

How does it work?

Copilot is a machine learning model that has been trained on a large amount of code, all of which is open source and available on GitHub. This means that it has access to a lot of different types of languages, projects, and code styles.

How can it help me?

Code completion

To state the obvious, it gives autocomplete suggestions based on what you want to write. And it has done it with frightening accuracy for me so far. In many cases it just fully writes functions based on a the function name. Which might not sound too impressive, after all, code snippets have been around for a while. But the difference is that it's not just a snippet, it's the full function. Code snippets are often just a starting point for things like loops. Copilot, on the other hand, will write full API calls for you, which is a huge time saver.

In my case, I write a lot of AWS integrations in Ruby, and Copilot has been able autofill AWS SDK calls for me. Which means less time going through the documentation and more time writing the actual code. That's not to say you shouldn't read the documentation, you should. But it's nice not to have to look for specific parameters, which AWS has a lot of.

Blog Writing

I've been using Copilot to write this blog post, actually. Not the whole thing, but it has been a huge help in writing. Sure, the texts it comes up with aren't perfect, but it is a good way to get prompts for your writing. If I ever get stuck on a sentence, I just ask Copilot to help me out and it usually comes up with something that I can use. Like this previous sentence, all I had to type into my editor was "If I ever get stuck on a sentence,", and Copilot came up with the rest.

Do I recommend it?

Yes, and no. It's been a huge help in my day to day work, and I can't imagine not having it anymore. Which might also be my main concern. Copilot is at its best when used as a tool to help you speed up building functions. But it won't actually write your code for you.

If you're writing a lot of API integrations, which are often the same, Copilot can be a huge help. But if you're writing a lot of highly specific code, it might not be as useful. You can try it out for yourself here.

As always, we hope this post was helpful and feel free to share with us your ideas or feedback via our Support Channel.

Keep up-to-date with the latest news