GitHub Copilot blew my mind on a code-along exercise

Niraj Shrestha
3 min readNov 18, 2021

GitHub Copilot has surprised me beyond what I could have ever expected. I guess artificial intelligence is more capable than I thought initially, and this is a great example of how it can help us to code faster and better.

My idea about using GitHub Copilot as a web developer was that it will be suggesting function and method names with a hint of what the method could do given a comment previously written by the programmer. My mind exploded 🤯 when it actually suggested the full code on a video code-along exercise I was doing on Ruby!

The guessing game

I honestly had forgotten I installed the Copilot extension on VSCode. On a Saturday morning, I started with my regular studying ritual: I opened VSCode on half of the screen, which I had to update, something that included the enabling of GitHub Copilot (more on that later). The day before, I started working on a method and I was planning on continuing doing so.

So, halfway through the video tutorial, I started typing away on my VSCode editor:

def a

I couldn’t contain my excitement, and I started smiling like a 6-years-old on a Christmas morning.

But then I thought: 🤔 “I should disable this because otherwise, I won’t be doing any code by myself, which is the whole point of the coding-along!”.

Even though I can see how useful and amazing this tool is, I won’t be using it during my coding-along exercises. But I will definitely use it when building projects! It speeds up the development process greatly and helps to reduce mistakes.

What is GitHub Copilot?

GitHub Copilot is an extension that can be installed in most IDEs and text editors (including VSCode) and suggests lines of code, or entire functions, based on the OpenAI engine. As it is trained on billions of lines of public code, I’m guessing the code from the Udemy video is on a public GitHub repository, allowing Copilot to match my code with the code in its database and make suggestions accordingly.

You can learn more about this AI pair programmer on its official website.

How to get GitHub Copilot

Is GitHub Copilot working for us, or are we working for it? This tool uses our code to, in turn, suggest code right back to us.

So, the question many are pondering is: are we feeding a monster that will replace us as developers and unleash the power of Skynet on the world?

Or is it just a tool to improve our work, and still lacks the creativity that we, humans, have when coding?

--

--