Skip to main content

Generative AI

Using GitHub Copilot in VS Code

Istock 1352825028

Let’s be honest – coding isn’t always easy. Some days, you’re laser-focused, knocking out feature after feature. Other days, you stare at your screen, wondering,
“What’s the fastest way to write this function?”
“Is there a cleaner way to loop through this data?”

That’s where GitHub Copilot comes in.

If you haven’t tried it yet, you’re seriously missing out on one of the biggest productivity boosters available to developers today. In this blog, I’ll walk you through how to use GitHub Copilot with Visual Studio Code (VS Code), share my personal experience, and help you decide if it’s worth adding to your workflow.

What is GitHub Copilot?

Think of GitHub Copilot as your AI pair programmer.
It’s trained on billions of lines of public code from GitHub repositories and can:

  • Suggest whole lines of code or entire functions
  • Autocomplete loops, conditions, or boilerplate code
  • Help you learn new frameworks or syntaxes on the fly

It’s like having a coding buddy that never sleeps, doesn’t get tired, and is always ready to assist.

Setting Up Copilot in VS Code

Getting started is easy. Here’s a step-by-step guide:

Step 1: Install Visual Studio Code

If you don’t have VS Code installed yet, you can install it from here.

Step 2: Install the GitHub Copilot Extension

  • Open VS Code
  • Go to the Extensions tab (Ctrl+Shift+X)
  • Search for GitHub Copilot
  • Click Install

Or directly visit here to find the extension.

Step 3: Sign in with GitHub

After installing, you’ll be prompted to sign in using your GitHub account.

Note: GitHub Copilot is a paid service (currently), but there’s usually a free trial to test it out.

How Does Copilot Work?

Once set up, Copilot starts making suggestions as you code. It’s kind of magical.

Here’s how it typically works:

  • Type a comment describing what you want
    • Example:
// Function to reverse a string

Copilot will automatically generate the function for you!

  • Write part of the code, and Copilot completes the rest
    • Start writing a “\for\” loop or an API call, and Copilot will suggest the following lines.
  • Cycle through suggestions
    • Press Tab to accept a suggestion, or use Alt + [ / Alt + ] to browse different options.

Real-Life Use Cases

Here’s how I personally use Copilot in my day-to-day coding:

Use Case Why I Use Copilot
Boilerplate Code Saves time writing repetitive patterns
API Calls Auto-completes fetch or axios calls quickly
Learning New Syntax Helps with unfamiliar frameworks like Rust or Go
Unit Tests Suggests test cases faster than starting from scratch
Regular Expressions Generates regex patterns (saves Googling!)

Tips to Get the Most Out of Copilot

  1. Write clear comments:
    • Copilot works better when you describe what you want.
  2. Don’t blindly trust the output:
    • It’s smart, but not always correct.
    • Review the suggestions carefully, especially for security-sensitive code.
  3. Pair it with documentation:
    • Use Copilot for assistance, but keep the official docs open.
    • Copilot is great, but it doesn’t replace your understanding of the framework.
  4. Use Copilot Labs (Optional):
    • If you want more experimental features like code explanation or refactoring suggestions, try Copilot Labs.

Is Copilot Replacing Developers?

Short answer? No.

Copilot is a tool, not a replacement for developers.
It speeds up the boring parts, but:

  • Critical thinking? Still you.
  • Architecture decisions? Still you.
  • Debugging complex issues? Yes, still you.

Think of Copilot as an assistant, not a boss. It helps you code faster, but you’re still in charge of the logic and creativity.

Pros and Cons of Copilot

Pros

  • Saves time on repetitive coding tasks
  • Reduces context-switching to StackOverflow or Google
  • Helps you learn new syntaxes quickly
  • Available right inside VS Code

Cons

  • Requires an active subscription after the free trial
  • Sometimes generates incorrect or outdated code
  • Can make you over-rely on suggestions if you’re not careful

Final Thoughts: Is Copilot Worth It?

If you’re someone who:

  • Codes daily
  • Works across multiple languages or frameworks
  • Wants to focus on the “what” and less on the “how”

Then GitHub Copilot is absolutely worth trying out.

Personally, I’ve found it to be a game-changer for productivity. It doesn’t write all my code, but it takes away the mental fatigue of boilerplate so I can focus on solving real problems.

Useful Links

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Saket Singh, Senior Technical Consultant

Saket Singh is a Senior Technical Consultant at Perficient GDC, Nagpur, specializing in Sitecore development with a focus on SXA, Sitecore Headless, and composable DXP architectures. With over 9 years of experience in enterprise web development, Saket brings deep expertise in ASP.NET, C#, MVC, Web API, MSSQL, and JavaScript. He is passionate about exploring emerging technologies, optimizing digital experiences, and building scalable solutions that bridge marketing and technology. Outside of project delivery, Saket actively shares insights through blogs and tutorials, aiming to simplify complex concepts for developers and digital teams.

More from this Author

Follow Us