GitHub Copilot Preview

Week 213 was posted by Charanjit Chana on 2021-11-22.

I was granted access to GitHub's Copilot preview a couple of weeks ago and only just around to installing it to give it a go. It's an interesting concept and it's name is an excellent at describing exactly what it's for.

After my brief play with it for HTML and PHP documents I can see how useful it is but I wouldn't have the confidence to let it run the show which is why it's name is perfect.

For a basic HTML structure, it heavily leaned on Bootstrap, something I've used extensively but rarely by choice. The markup is fine, but not lean enough for my liking. For CSS it came up with some interesting choices like specifying exact pixel values for H1 and H2 elements, but overall the output would definitely be a time saver for someone writing code day in day out.

Screenshot showing how GitHub Copilot tries to autocomplete an anchor tag in HTML

The example above is pretty simple but tries to take autocompletion to the extreme. It's not just adding the necessary tag(s), it's also specifying the values. It works for pretty much any element I tried it with which could be a massive time saver. On the previous project I worked on that used Bootstrap, it could genuinely have saved me minutes a day, hours a week and days a year in development time.

For PHP, I was actually more satisfied with the output even if it didn't always pick the right function or get a functions usage right. It needed a bit more hand-holding through a simple reverse array task, it just seemed to take the function name I chose and did it's best to complete the entire thing, not just the current line. The same was true for JavaScript it's just that my simple example seemed to generate output that was overly complex, in my opinion.

One very nice thing I noticed in the docs was the ability to cycle through multiple options, using the ALT + ] shortcut on a Mac.. shame it didn't work for me. I could hover and choose the 'Open GitHub Copilot' option and see a collection of alternatives and choose the one that suited me best. It didn't always come up with more than one suggestion, but for every line I wrote during my test there was autocompletion available and at least half the time that spanned multiple lines.

I've been an Atom IDE user for the longest time and generally find Visual Studio Code over the top for my needs but I'll be using it for the foreseeable so I can test Copilot out some more.


Tags: copilot, development, github


Tweet WhatsApp Keep Upvote Digg Tumblr Pin Blogger LinkedIn Skype LiveJournal Like