In this article I’m going to cover how I use GitHub’s Copilot offering while coding to (mostly) automate away small or repetitive tasks.
What is Copilot?
Copilot is GitHub’s AI coding companion, assisting development with autocomplete suggestions and a (soon to be made generally available) chat client. It has plugins for most major IDEs so you have AI assistance while working on your coding projects.
I have been using Copilot now for just under a year and it’s completely changed the way I code. I can spend less time writing small or repeatable functions and more time thinking about more intricate problems that require solving.
GitHub Copilot · Your AI pair programmer
GitHub Copilot works alongside you directly in your editor, suggesting whole lines or entire functions for you.
How does Copilot work?
This is a great blog post from GitHub that explains how Copilot uses various sources to decide how best to suggest code when you hit Return to start a new line and a new prompt.
How GitHub Copilot is getting better at understanding your code
With a new Fill-in-the-Middle paradigm, GitHub engineers improved the way GitHub Copilot contextualizes your code. By…
Lets (not) do some coding!
We’re going to write a completely random project here to demonstrate the power of prompt engineering with Copilot and how important it is to give it all of the required information as early as possible.
With no prior knowledge of any of the packages involved, we are going to be using almost entirely Copilot prompts to write a tool to download a random comic from XKCD and display this in a window on your machine.
As usual, you can find the code and prompts used for this project on the below Github repository: