Friday, February 2, 2024

GitHub Copilot First Impressions

I am aware that it has been a while since Copilot came out. I was a bit hesitant to install it because I wasn't sure that it would be a service I would use enough to justify paying for it. Also, the morality behind how it was built felt a bit icky to me, but I can see how it would be good for us in the long run.

1. Installation

I installed it a few days ago. I am using VSCode with Go, and I must say, the installation process was quick and painless. I could see suggestions in my code instantaneously. I also started writing a function mapping two types of payment methods, and, although the suggested structs were not the right ones, the logic was usable. I can see it will definitely be useful for naming things.

2. Authentication

The authentication part was not my favourite, to be honest. I was hoping that once I log in from VSCode it won't require it again, but the notification did pop up multiple times when switching between projects or restarting my machine. I did not investigate where it was coming from, it could be something set in the IDE, I just found it worth mentioning.

3. ChatGPT

I had some experience using OpenAI's ChatGPT to generate a function that required logic to calculate if one timestamp was found in between two other timestamps. This one was buggy, and it took me some time to understand where the bug was coming from and provide a fix. I am still using ChatGPT for generating documentation and tests, and for that it is great. Documentation is general enough so that I can add the parts that behave differently in my code very easily. With tests, I also prefer to have the debugger set up in my VSCode, so I can see exactly what is happening step by step.

That being said, I believe the use case is very different, and I feel Copilot feels much more like my pair programming partner lives inside the IDE, rather than outside of my computer - the feeling I get when conversing with ChatGPT.

4. Shortcuts

The basic keyboard shortcuts are intuitive, I believe many other tools are using the same combinations. Their official list is nicely formatted in a table that is easy to read: https://docs.github.com/en/copilot/configuring-github-copilot/configuring-github-copilot-in-your-environment?tool=vscode

For now, I did not feel the need to overwrite any of them, but it definitely is nice to have the option.

5. Suggestions

For what it is worth, I am happy with the suggestions I have been getting so far, but as I said, it has only been a few days. The code is not always compilable, but given that I am familiar with the codebase, I find it easy to find the necessary data structures in different packages. If I just started a new project, I think I would disable Copilot, at least until I get familiar with the codebase during my first few tasks. On the other hand, I could also see the benefit of using it on an easy task that does not rely heavily on the rest of the code.

I will have to go through the documentation of GitHub Copilot, so I can discover all its features. I can already see that they have a chat function in beta on the JetBrains IDE, similar to what ChatGPT is providing - I am definitely looking forward to giving that a go!

Building Resilience

In the beginning of the year we had a conversation with my manager about my yearly goals. Due to the nature of my current project and the ne...