GitHub Copilot

A week ago, I received an E-Mail that surprised me a bit. I was familiar with the GitHub Copilot project, and had even signed up to test it. I did not anticipate being an early tester. The idea of an AI-powered auto-complete for writing code interests me. Being able to produce code with just a comment sounds very useful. It sounds almost too good to be true.

Naturally, as the saying goes: If it sounds too good to be true, than it probably is. My first impressions of the plugin weren't as amazing as I had imagined. Of course, the provided demos are tailor-made to try and show off the tech as nicely as possible. Producing specific blocks of code to perfectly fit the comment statement provided. In my own personal use, it will provided suggestions for what I want it to produce. Often, it will get into these endless loops of suggesting a specific detail over and over.

This all pales in comparison to my biggest issue: stolen code. I do not consider code generated by an AI 'stolen'. So long as that code was produced by the AI. That code is then, no more than just boilerplate code. However, there are cases where the plugin will generate code that are not original. I wouldn't even call it "generic boilerplate" code. Not when the plugin suggests adding in comments stating who the real author of the code is. This is a nightmare, especially for those who are particular about software licenses.

Questionably produced code aside, copilot isn't above recommending less than helpful code. Plenty of times, it will try and suggest code for something that I am working on. However, the code will work on the framework or structure that it assumes that I am using. A recent example: I was designing packet headers for a networking assignment. I was setting the array of uint_8 and stating which bits of the array corresponded to what header info. When it came to recommending code, copilot suggested an entirely different structure, one which I could not follow due to the requirements of my project.

An Upside?

What copilot can do very well, is produce boilerplate code for basic functions. If I need a sorting algorithm for an pointer array, it can produce it. If I need a function to accomplish a simple task, it can do it. If I need it to produce the skeleton of a class, it can. It is very good for producing a large volume of code quickly. Reducing the time that I need to spend writing otherwise menial code is always a benefit. I want to spend time working on solutions, not typing up implementations of functions that get and set basic variables.

Sure, it's just in beta. Hopefully it will be updated to remove the glaring issues. If microsoft truly cares about copilot, I expect they'll iron out anything that could potentially run them into issues with licensing. They can't buy out everyone on github. Even in the current state, I found it useful. I wouldn't recommend it to anyone who's starting out in the world of programming. Two reasons, firstly: what good is code you don't understand. Secondly: how would you know what to ask it? I see this as a good tool for the experienced programmer who'd like to speed up their work. I'll personally be keeping it in my box of tools.