Why Use GitHub Copilot And Copilot Labs
Practical Use Cases for the AI Pair Programmer

Developer Advocate @ GitHub
Search for a command to run...
Practical Use Cases for the AI Pair Programmer

Developer Advocate @ GitHub
No comments yet. Be the first to comment.
In this series, I will document technical tutorials for navigating GitHub's awesome features!
Introduction One major benefit of version control is that you can roll back your code to any time in history without significantly disrupting your teammates. However, reverting your code isn’t always straightforward, especially when you’re still lear...
Raise your hand if you've been personally victimized by the question: 'Will AI replace software engineers?' It's a common debate that drives developers to extremes—either avoiding AI entirely or frantically signing up for every AI course available. ...
I recently went down several rabbit holes about building WYSIWYG editors and popovers. While on maternity leave, I finally have time to deeply explore random technical problems without deadlines - a rare opportunity. Thus far, I've focused on contrib...
This blog post uses storytelling to introduce beginners to Verifiable Credentials, followed by a tutorial on creating them in JavaScript and Kotlin. In Our Last Issue... In our previous issue, we met Dawson Webhart, a junior frontend software enginee...

"Our current credit system says, 'Saddle yourself, so we can give you more to saddle.'" Eric Lapin, President of FormFree, stated during a recent TBD live stream. His comment sheds light on a fundamental paradox of the U.S. credit system: it often re...

Technology adoption doesn't happen with one software engineer coding in solitude. Even though big companies like Meta and Microsoft boast of their humble beginnings in a dorm room or a garage, product adoption requires good marketing. Many software e...

Black Girl Bytes
58 posts
I'm a Developer Advocate at GitHub. I'm passionate about community, code, and education! Reach out to me on Twitter ❤️
Even though I didn't work at GitHub when they announced Copilot, I remember it piqued my interest. Perhaps, I was mostly excited because it was new and shiny. (Also, because I love predictive text in other environments like writing emails, why not in my code editor?) When I received access to the feature, I realized two things:
For me, the value of Copilot is that I spend less time stressing over syntax, which leaves more time for solving problems.
More recently, GitHub Next, a team exploring the future of technology and software beyond the adjacent-possible, released Copilot Labs. This experimental VS Code sidebar enables developers to translate their code from one programming language to another and explains code snippets in plain language.
With Copilot and Copilot Labs, you can:
These sound super cool, but when would you use them?
I share my favorite use cases of GitHub Copilot and GitHub Copilot Labs in this blog post.
Before I go into how I've used Copilot, I'll explain the feature to those unfamiliar with it.
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work. GitHub Copilot draws context from comments and code, and suggests individual lines and whole functions instantly. GitHub Copilot is powered by OpenAI Codex, a new AI system created by OpenAI. The GitHub Copilot technical preview is available as an extension for Visual Studio Code, Neovim, and the JetBrains suite of IDEs.
TLDR: In other words, GitHub Copilot is an IDE extension that provides predictive code based on comments that you write and patterns in your code.
Please note: GitHub Copilot is in technical preview, and thus not all users will be able to access this feature. Please join the waitlist if you'd like to sign up for the technical preview.
Whether I'm working as a software engineer or a developer advocate, I've found myself in moments where I'm writing code at the last minute or I'm experiencing a coder's block. Reading suggestions from Copilot reminds me of how to solve common day-to-day algorithms. You can read one of my blog posts about how I used Copilot to write and understand a binary search algorithm.
For example: In one project, I had to read a file, order it alphabetically, group it by letter, insert a new element in the correct alphabetical spot, and then write the updated contents back to the file. Fortunately, Copilot helped me write a solution. See below:

While I understand that writing tests for your code are essential, I don't enjoy it. I often take forever to start – trying to remember the difference between keywords like mock, nock, beforeEach, and afterAll. Then, when I get the pattern down, it feels like a tedious process for me to reach a particular test coverage percentage. This is where Copilot can come in handy. I can write a few comments describing what I want to test; then, Copilot may suggest the code needed for the test. I can also start writing tests, and Copilot may provide anticipated code for other needed tests. Learn more by reading Using GitHub Copilot to Automate Tests by Colby Fayock.
Sometimes, writing great comments ends up on the backburner. There's a tendency to assume your code is clean, readable, and doesn't need comments until you return to your code the next day and you're unable to decipher the hieroglyphics. Since well-written comments tend to trigger better results from Copilot, I'm more motivated to write explicit, relevant comments (and I leave them in my code insert mindblown emoji).
I'm also not fantastic at pair programming, especially when I'm the less experienced engineer. I experience anxiety from people watching my every move, especially while I code. What stops me in my tracks is that I'm often trying to remember the syntax. With Copilot, my pair programming buddy spends less time watching me Google "reduce javaScript array method" for the umpteenth time. Instead, it may suggest the correct syntax for me.
Before I go into how I've used Copilot Labs, I'll explain the feature to those unfamiliar with it.
Copilot Labs is separate from (and dependent on) the GitHub Copilot extension. While Copilot continues to march toward general availability, Labs will be a proving ground for experimental applications of machine learning that improve the developer experience. Currently, Copilot Labs consists of a VS Code sidebar that houses distinct features starting with “explain this code” and “translate this code”.
Whether you landed a new gig or joined a new open source community, there's no easy answer to building a mental model of a new codebase. It can take months, and codebases evolve. While Copilot Labs can't explain the entire codebase to me, I can use it to describe code blocks within a new codebase.
Typically, software developers copy and paste solutions they find on StackOverflow, which is completely fine. Still, it's necessary for us to understand what we copied and why it works. Leveraging Copilot Lab's "explain this code" feature enables me to copy code from StackOverflow AND understand what the code is doing.
I learn best from reading, watching, and doing, which means I need various resources to create a robust mental model. When I've studied for interviews, colleges exams, and coding bootcamp, I'll watch videos, complete LeetCode exercises, and write an explanation of the code. Copilot Labs serves as an additional resource giving me more context on why and how specific algorithms work.
I mentor early-career developers. I'm helpful when they are currently students in the program where I mentor, but once they graduate and start working at jobs with different technologies, I'm useless. There are multiple moments when they've asked me to help them with Python or Ruby, and I'm unable to assist because I'm not familiar with those languages. With Copilot Labs, I can translate my mentee's code snippets to read the code in a familiar language, gain a better understanding of their code, and then lead them in the right direction. It even helps me explain to the mentee what's going on in their code because sometimes, as a newer developer, you're not sure why code works, but it does!
Want to see Copilot Labs in action? Watch this YouTube short as @MishManners uses Copilot Labs to translate code. {% youtube RBj3BKm54BY %}
Share ways that Copilot and Copilot Labs are useful to you in the comments below.
If you have any feedback you want to share with the team at GitHub, use the Discussion board.