Skip to main content

How Copilot Won Me Over

· 2 min read
Morgan Moneywise
CEO at Morgan Moneywise, Inc.

Copilot is a service from GitHub that uses machine learning to help you write code. It was made generally available to the public on 21 June 2022.

As a person working in AI, I was very skeptical about this feature, and did not bother trying it for a long time. I expected it would generate code that is so buggy that it would be more productive to write the code by hand.

Until one day, a colleague whom I had a lot of respect for was singing praises about how Copilot helped him write a complex piece of code, and I decided to give it a try.

I was immediately annoyed by the fact that I had to type # in my code to prompt Copilot because I did not want to litter my code with comments (I identify with the camp that thinks many comments are a sign of code smell 😃).

The turning point came when I was writing a python script to read the MovieLens 1M dataset. I was trying to write a function that would read the movies.dat file but was thwarted by an encoding error that pandas threw when reading the file.

I usually resort to doing a Google search to find a solution but since I had Copilot installed, I decided to give it a chance first.

This video captured what ensued:

I don't know if Copilot actually read the file to figure out the encoding or it was just making a statistically good guess, but I really appreciated the time it saved me from having to do a Google search.