Unlocking Efficiency: My One-Month Journey with GitHub Copilot in Visual Studio Code

Over the past month, I’ve embarked on a coding journey with a trusty companion by my side — GitHub Copilot integrated into Visual Studio Code. This AI-powered coding assistant has been nothing short of impressive, revolutionizing the way I write code. Let me share my firsthand experiences and insights on how Copilot has made a significant impact on my development workflow.



A Seamless Experience

One word that comes to mind when I think of Copilot is ‘seamless.’ It seamlessly suggests methods and completes code snippets, accurately hitting the mark eight out of ten times. This incredible efficiency boost has made coding both enjoyable and productive. Gone are the days of slogging through documentation or fumbling through syntax errors; Copilot has your back.

Let’s dive into a few aspects that have made Copilot my go-to companion for the past month.

  1. Effortless Coding for Common Tasks

    GitHub Copilot shines brightest when tackling everyday programming tasks. Whether it’s writing loops, crafting conditions, or implementing recursion, Copilot consistently delivers on-point suggestions. For example, if I am accessing an array or list, Copilot starts suggesting .ForEach loop, and many a times, further implementation in the loop which is near correct 60–70% of the time.

  2. Method Name Suggestions

    One of my favorite features is Copilot’s ability to suggest method names. This is particularly handy when working on larger projects where naming conventions matter. Copilot seems to have an uncanny knack for proposing intuitive and relevant method names.

  3. TypeScript Compatibility

    In my experience, Copilot shines even brighter in TypeScript projects. TypeScript’s strong typing often requires meticulous attention to detail, and Copilot’s ability to infer types and provide relevant suggestions makes the development process smoother and more enjoyable. For context though, I have only used Copilot for TypeScript and HTML languages in VS Code, and I am comparing the typescript compatibility to HTML in this case.

A Few Minor Hiccups

While Copilot has been a game-changer, it’s not without its quirks. There have been instances where it goes slightly off track, and it’s important to exercise caution.

  1. Inventing the Unseen

    One occasional annoyance is Copilot’s tendency to invent code elements that don’t exist in your project. For instance, when referencing an ENUM value, Copilot might suggest enum values that sound legitimate but aren’t part of your codebase.
// Copilot suggesting ENUM values that don't exist
enum Color {
    Red = "RED",
    Green = "GREEN",
    Blue = "BLUE",
}

const selectedColor = Color.Blue;

// Copilot suggesting: Color.Magenta (which doesn't exist in the enum)

While Copilot’s inventiveness can sometimes be useful, it’s crucial to verify its suggestions, especially in more complex scenarios.

Overzealous Property Generation

While referencing DTOs (Data Transfer Objects) or similar structures, Copilot occasionally suggests properties that are not present in your data model. While it aims to be helpful, you might find yourself cleaning up unnecessary code and if you just blindly implement every suggestion, you might find reference to a property or two, that doesn’t even exist, and have to handle compilation errors.

Conclusion: An Invaluable Coding Companion

In essence, Copilot is like having an experienced pair of coding hands always at the ready. It’s not here to replace developers but to empower them. With Copilot by your side, you can code faster, more accurately, and with a lot less hassle.

So, if you haven’t tried GitHub Copilot in Visual Studio Code yet, I wholeheartedly recommend giving it a go. It might just become your new best friend in the world of coding.

Indraneel Pole