Navigating the AI-Assisted Coding Landscape with GitHub Copilot

Stephen CollinsDec 30, 2023

In the ever-evolving world of programming, GitHub Copilot has emerged as a notable tool for developers. As someone who has recently dived into this tool, I wanted to share my personal experiences and insights in this newsletter issue.

The REST API Test Project: A Nearly Complete Success

My adventure with GitHub Copilot began with a test project: a simple REST API using Express, interfacing with a MongoDB database. Impressively, Copilot autonomously wrote about 94% of the code. However, it stumbled in creating a MongoDB user, which led to authentication issues between the API and database server. This hiccup highlighted Copilot’s limitations in certain specific tasks.

The GIF Generator Python Script: An Unresolved Mystery

While creating a GIF generator Python script, Copilot, much like GPT-4 (ChatGPT), struggled to produce a smoothly animating GIF from a sprite sheet. Despite this, I found ChatGPT marginally more adept in this scenario.

Pro Tips for Optimizing AI Assistance

A gem of wisdom I picked up from a user named “sopotcela” on Threads involves a simple trick: write a one-liner comment and let Copilot suggest the next line. This approach enhances the utility of Copilot, though mastering it comes with a learning curve.

Solid.js: A Tough Nut for Copilot to Crack

When dealing with newer UI libraries like Solid.js, Copilot often stumbled, add made mistakes in providing syntactically incorrect autocomplete suggestions, like an extra bracket or code that isn’t part of the given library’s API. This indicated its relative unfamiliarity with Solid.js.

A Dual-Tool Strategy: Copilot and ChatGPT

I found myself using both Copilot and ChatGPT in tandem. Copilot excels in speeding up code writing, while ChatGPT shines in higher-level brainstorming, architectural discussions, and tackling trickier bugs.

Autocomplete on Steroids? Yes, But…

Copilot feels like a hyper-charged version of autocomplete. However, it sometimes misses the nuances of lesser-used UI libraries. For instance, Solid.js, unlike React, doesn’t require keys due to its build-time component abstraction, a subtlety Copilot often overlooks.

Leading the Completion: A Quasi-Conversational Approach

Understanding that the underlying large language models are more completion-oriented than conversational, I’ve learned that guiding Copilot with clear, leading comments can yield more accurate results.

The Backend vs. Frontend Divide

Interestingly, Copilot appears more adept with backend tasks than frontend ones. This distinction became especially clear in my experience.

The Bleeding Edge: Copilot’s Achilles’ Heel

When it comes to bleeding-edge web frameworks, Copilot’s limitations become apparent. It struggled with Astro.js version 4, Solid.js, and was particularly unhelpful with Pocketbase’s SDK in the backend of my Astro.js website. It seems the tool is not quite up-to-speed with the newest JavaScript libraries and frameworks, though it remains handy for regular expressions and basic logic handling.

Final Verdict: A Mixed Bag

In summary, GitHub Copilot is sometimes helpful, but I’ve rarely been impressed. More often than not, it gets in the way, especially with the latest libraries and frameworks. While it holds potential, there’s a clear need for improvement, particularly in staying current with the latest developments in technology.