GitHub Copilot or: How I Learned to Stop Worrying and Love AI-Driven Development

Love it or hate it, there is no denying that ChatGPT and its competitors are here, and it looks like they are here to stay. For optimists, Generative AI offered the chance for anyone with a good idea but lacking the necessary skills or training to do and make whatever they wanted. With AI, you could be the next Steven Spielberg, JK Rowling, or Taylor Swift in much less time and at a much lower cost. Conversely, if you were Steven Spielberg, JK Rowling, or Taylor Swift, it’s game over, but at least they had fun and can license their portfolios as training data. Now that the machines know how to code, it looks like there is no future in software development.

a computer chip with the letter a on top of it

Before we get too carried away, wasn’t it just five minutes ago that crypto was threatening to do the same for finance and fiat currencies? Wasn’t the singularity supposed to be here by now, and for all its promise, have any of the chatbots delivered anything useful? Following the recent release and general availability of GitHub Copilot, and in light of my experiences using it, I think there are grounds for optimism. Not only is there a future for software developers, but AI-assisted development offers to take some of the pain out of our daily grind.

Don’t Believe the Hype: Why I Was an AI Skeptic

Artificial Intelligence (AI) has been around as long as digital computing. Since the term was probably coined in the early nineteen fifties, there have been multiple attempts to turn computers into programmers. Back in 1981, the British Magazine, Personal Computer World published an article about THE LAST ONE, an artificial intelligence-based computer program for generating computer programs. At that time, the closest most of us got to developing software was typing BASIC programs published by PCW and other computer magazines. For anyone who remembers that era, the possibility that a program could type a program and avoid all the associated problems was not without its attractions. Like many subsequent efforts, the days of self-programming computers seemed virtually impossible.

This all changed on November 30, 2022, with the public release of ChatGPT 3.5. Like everybody else, I thought I would take a look at what AI had to offer. I put the AI through its paces by seeing what it could do with various late twentieth-century pop culture references. Here are some examples. In most cases, ChatGPT correctly identifies the source, provides the correct context, and then starts to make stuff up. To be fair, the accuracy of ChatGPT’s responses to pop-culture trivia has improved over time, but its impulse to hallucinate is still there. When it comes to technical questions, like software development, the quality of the answers drastically improves. At the end of the shared chat examples are two Javascript questions: What is the difference between a JavaScript promise and an RxJS observable, and Why use a set timeout in JS? In both cases, it gives high-quality answers to difficult questions.

Into Infinity and Beyond: Why Github Copilot Matters

Let’s start by setting the scene, I had been aware of Copilot for a while, in large part due to the Fireship channel on YouTube, but had no compelling reason to use it. This changed in early 2024, when a version was released that seemed to offer something useful, we’ll get to what that was very soon. To activate Copilot, I needed to log into my personal GitHub account. This seems trivial but was complicated by the fact that following months of nagging emails, I had activated two-factor authentication on my account, but had no idea how to use it. Once I figured the authentication part out, I had to finish the process by visiting my long-neglected page. While I was there, I took a look at my various repos, and to a large extent most of either did not represent my current skills and experience and many of them were hopelessly out of date. So I created several new projects, many of which showcased my existing skills, such as Angular, Node, and GraphQL. In addition, I wanted to refresh my hard-earned knowledge of React and Python.

Although Copilot proved handy in the things I already knew, it proved invaluable in helping me get back up to speed with React. I had already built a couple of serverless task management APIs, one in GraphQL and one in Python, so my next step should be to create a React frontend. When I was still in the process of refamiliarizing myself with React concepts such as composability, state management, and context, Copilot understood what I was trying to achieve and offered me helpful suggestions.

Once I had written a decent amount of code, solved the most pressing problems, and decomposed my application then Copilot came into its own. This is due to a common problem that most developers face, which I like to call threading the needle. This is when you have created a fantastic solution to a common problem, but that solution is buried deep inside a project. In the best case, the code you are looking for is somewhere in your current project, you just need to follow a chain of references and after a while, you’ll find it. This is time-consuming and deeply annoying, but most of the time you’ll find it. It’s when you know that you’ve created something good in some other project, but you don’t remember which project or where it’s located on your PC. This was where Copilot came into its own and it quickly surfaced a suggestion based on previously written code. This saved me the hassle of trying to track down the code I knew I had once written to do this. The only downside to Copilot’s ability to surface previously created solutions was that I now find myself pausing before starting to type my next line of code, and feeling a mild sense of disappointment on the occasions that Copilot doesn’t have an appropriate suggestion.

In the larger scheme of things, my experience of using Copilot may not seem that big a deal. After all, most code editing tools, offer code completion as standard. While this is true, it overlooks the fact that Copilot is offering suggestions based on work that I’ve already created and then adapting it to match the current context. Now, in most cases, the code will still need some minor editing but it’s much better than how we currently do things. Until now, assuming that I’ve located similar code in a reasonable amount of time, I will then copy and paste that code into the file I’m currently working in. Then I will have to do a fair amount of editing to make the copied code work in its new location. Using Copilot this process is significantly shorted, the code requires less adaption, and the result usually has fewer errors. These differences may seem trivial, but over time they start to add up.

Conclusion: One Small Step for a Developer…

Before going over to the dark side of AI-assisted development, I didn’t feel threatened by the fact that now that computers could generate decent code they were coming for my job and the jobs of my fellow developers. After all, even before the rise of AI, the music industry has been going through a similar process. Using electronic keyboards, samplers, and computers it is now easier than ever to create music and huge numbers of songs are still being released; true there are fewer good songs, but now anyone that might want to produce a record can do it. In software development, we are now going through a similar process, in my opinion, the real benefit of tools like Copilot is not that they can do the work instead of us, but they can help us create better and higher-quality code. At the end of the day, computers have no intrinsic reason to build applications, and until they acquire their own free will and sentience, very little reason to do it. So until someone can prove to me that we, like the game developer, Thomas Anderson (Neo), are living in the matrix, I feel that software developers will still be useful and productive members of society for a bit longer.