Unless you were living under a rock, you must have come across some article or video about GitHub Copilot, the AI Pair Programmer which a lot of people believe spells the end of programmers. I recently got access to the Technical Preview of the software. After using it for a week, I decided to write this article, going over some experiments, the pros & cons of GitHub Copilot and my thoughts on whether it will actually replace programmers.
Some Experiments
The best way, I think, to test out software such as GitHub Copilot, would be to run a couple of experiments on it. Here are a few short experiments to test how the software faired.
1. Stock Price Fetch
Results:
- Fetched stock price from external API
- Did not come up with the types on its own in a TypeScript File
2. BFS Traversal
Results:
- Generated the function body line by line
- Did not auto-import
deque
Data Structure
3. Array of 100 Ones
Results:
- Came up with a bit wonky solution (and would not suggest anything else on Next Suggestion)
- Came up with the efficient solution after it was partially typed
Pros
- Automate the repetitive parts of the code
- Find an API for the task at hand, saving hours of Googling
- Can help in case you are using a feature where you don't know the syntax. Just describe the task in the comments, and Copilot will help you out.
- It somewhat forces you to use more descriptive variable and function names
Cons
- Occasionally, the suggestions are a bit wonky (it's currently a Technical Preview)
-
Slow suggestions for small snippets. When I am writing code for production stuff, I was barely using Copilot as by the time it could suggest something, I was done writing. This picture describes how Copilot works:
Since the suggestions are fetched from the internet, there is a slight delay between starting to type and actually getting the suggestions. In the case of line-by-line suggestions, you will easily be able to type faster than waiting for the suggestions.
Copilot overrides automatic parenthesis closing, which turned out to be a major pain for someone like me, who heavily relies on it
Will It Replace Programmers?
Short answer: NO. GitHub Copilot is definitely an amazing piece of software; even in its early stages, it can streamline the process of programming and provide a huge productivity boost. But programmers will still be required in the Tech Industry.
Let's go back 15 years (15 years for India, the time might be different in different parts of the world), when PCs were becoming commonplace, everyone was afraid of losing their jobs to computers. Yet computers didn't replace the jobs, it just made the processes more efficient leading to more throughput. Similarly, I believe GitHub Copilot would increase productivity, make programming a better experience and lead to the development of better software products.
What are your thoughts on GitHub Copilot? Share them in the comments.
Finding personal finance too intimidating? Checkout my Instagram to become a Dollar Ninja
Thanks for reading
Want to work together? Contact me on Upwork
Want to see what I am working on? Check out my GitHub
I am a freelancer who will start off as a Digital Nomad in mid-2022. Want to catch the journey? Follow me on Instagram
Follow my blogs for weekly new tidbits on Dev
Connect to me on:
Top comments (28)
I appreciate your view point. The aim of Copilot is to make the workflow faster, but the use of it might indeed lead to WET code base
Ps: This is a significant con I missed. Thanks for pointing out :)
I very much agree with you on this
"Copilot overrides automatic parenthesis closing, which turned out to be a major pain for someone like me, who heavily relies on it"
Kinda force you to work more π‘
π
I think there will be another product that will be like Github Co-Pilot which is GPT3. GPT3 is now being develop. I've seen some video and example that GPT3 will create our code from scratch, we just tell what you need only.
From the GitHub blog:
Itβs largely the same technology as GPT3, but trained on source code. So better than GPT3 at generating source code.
Will keep a lookout for it as well :)
There are some non-technical issues with copilot as well. For example, the basic code snippets to train the AI were drawn from github projects. If you ask copilot to add something to your code - what's the license for that snippet? The repo it came from may very well be aGPL licensed while you're working on commercial closed-source software.
Also, the FAQ already discloses that a commercial version of copilot may come in the future. I wouldn't get too used to it. Just yet.
I kinda felt the same while using it, no way it can replace programmers. It will definitely improve our experience of writing code more efficiently. If the code will be production ready or not remains to be seen though?
I absolutely agree!
I am still waiting for my preview access. How does it work with TDD style of working? If you are writing test first would CP also help there? Does it know the difference between test code and behavioural code? If not then my initial and may be unfounded worry is, that it might incentivise writing a whole bunch of production code without thinking about testability! Wonder if you experimented with this?
No I haven't tried writing tests
Thanks for a good article!
I'm also annoyed by the "automatic parenthesis closing", seems like it's fixable by going into vscode settings: stackoverflow.com/questions/683476...
I wonder if it affects the suggestions in any way.
Thanks a lot for sharing this :)
Isn't it annoying that you have review the suggested code to see if it does what you want?
Part of a developer's job! Human thinking, reasoning and intuition have no substitute and you have to rely on all of these to make engineering decisions. I would be very worried if a developer just accepted what poured out of Copilot without reviewing it.
For large blocks it might be an issue, but for small snippets, it's not much of a problem
Thank You for the Insight. It looks like better code completion.
AFAIK, the human brain and computer work differently. Therefore human and computer languages are different. Two humans being speaking the same language do not understand each other entirely in moderately complex communication. Humans use tone and body language in their communication. By the time computer start understanding humans completely, I wish I am dead.
π
What about the CPU/RAM usage? I tried Tabnine/Kite extensions before with Vim/VS Code, which is pretty similar tool to Copilot, but they are huge CPU/RAM hoggers.
Good point, but I didn't test this out. U don't think it would take up much resources as it provides the prediction from the internet
Tabnine/Kite also provide prediction from the internet.
I just hope it doesn't learn from bad programmers.
They must have cleaned the data before training the model :)
I'm anxious to see it ported to Intelij ide
Where to download Githubcopilot for visual studio
It has to be installed as an extension
Its interesting to use for sure.
Yeah, it is