GitHub Copilot — Primer Part 1

Augmented Code Generation with Modern Tools

Graham Waters
3 min readJan 11, 2023

GitHub Copilot is a new AI-powered code completion tool designed to help developers write code more efficiently. It is now available as a plugin for VS Code, which can be easily integrated into your existing coding workflow.

Photo by Rubaitul Azad on Unsplash

Supplying the following as a comment will automatically produce the function shown in Figure 1 with Copilot.

This function takes a string as its input, and reverses 
the order of the characters in the string.
then it removes all the letters that are in prime positions
in the string such as the first, third, fifth, etc.
an example: "hello" would become "hllo" because...
the first letter is in position 0, which is not considered a
prime, so it is kept.
the second letter is in position 1, which is not prime, so it is kept.
the third letter is in position 2, which is prime, so it is removed.
the fourth letter is in position 3, which is not prime, so it is kept.
the fifth letter is in position 4, which is prime, so it is removed.
the result is "hllo".
The function returns the resulting string.

One of the key features of GitHub Copilot is its ability to understand the context of your code. This means it can suggest more accurate and relevant code completions, reducing the need for you to switch between different tabs or search…

--

--