My first 6 months with Github Copilot

by Nick Hu
03 May 20222 min read

Has Copilot changed my life? Do I still need to write my own code? Are all my secrets being sent to Microsoft (owner of GitHub)?

In June 2021 GitHub announced a technical preview of their AI powered paired programmer. Needless to say as a self described “lazy developer” I registered my interest straight away. After an arduous 5 months of writing code all by myself I was graced with an email, “Welcome to GitHub Copilot”. This was it, I was ready to adorn my muumuu, set up my drinking bird and let my new AI assistant do all the programming for me.

Well, believe it or not, this was not the case. For the last 6 months I have still written a lot of code. However, overall, Copilot has been quite useful. What sets Copilot apart from other code suggestion tools is its ability to understand natural language.

For example, handling the pagination of a GraphQL query response. One requirement was that the returned results should be filtered by a user-selected group i.e., “You”, “Team” or “All”. When a user changes that group a useEffect hook should reset the results back to the start.

// reset offset and page if group changes
useEffect(() => {
    setOffset(0)
    setCurrentPage(1)
}, [userGroupSelection])

In the example above, I wrote the comment and then Copilot was able to write the whole function for me. The above example is rather simple, but I have experienced Copilot writing more complex functions involving maths and comparisons. It was even able to convert a rather complex SASS function I had pasted as a comment above my code into an Emotion styled component function.

Whilst not ideal, sometimes as a developer you’re given csv data to convert into something for a front-end component to use as a reference. In the past, I would have written a short function that parses the data and returns an array of objects. Now, this is where Copilot really comes in handy.

Step 1: Paste the data as a comment at the top of the file

Step 2: Build out the structure and the first object

Step 3: Let Copilot do its magic, have it do the rest.

Sadly, GitHub Copilot has no way of turning these crazy futuristic designs that our designers make into HTML/CSS. It can’t even centre a div.

So, will developers be needed in the future?

Well, I am happy to announce that we will be able to keep our jobs for a little while longer. Although GitHub’s Copilot is a great tool, it still requires a fair amount of hand-holding and a competent developer behind the wheel. Being a developer is more than just writing code. A developer needs to consider the implementation, tech stack, user flow and finally deployment.

Sign up and stay in the loop!

Your email address

No spam and no sharing of your details. Just useful thoughts and ideas in your inbox. :)