There are several fascinating applications of artificial intelligence and machine learning in our daily lives. AI is helping us in all aspects of our life, whether we’re attempting to read our emails, obtain driving directions, or find music or movie suggestions.
AI has even made its way to improve developers productivity, which is impacting developers in their daily tasks and at workplace. Further speaking it has become capable to write code which can assist developers and helps them in developing software much faster and easier.
Before starting let’s understand what exactly GitHub Copilot is
What is GitHub Copilot exactly?
GitHub Copilot is your AI pair programmer that can help you write code faster and with less work. It draws context from the code you’re working on, suggesting whole lines or entire functions. It helps you quickly discover alternative ways to solve problems, write tests, and explore new APIs without having to tediously tailor a search for answers on the internet. As you type, it adapts to the way you write code, to help you complete your work faster.
GitHub Copilot utilizes OpenAI Codex, a modified version of GPT-3 (a language model meant to generate human-like writing) that is intended to generate legitimate computer code. Copilot is trained on public GitHub repositories.
For more information: https://copilot.github.com/
Gist of copilot
Let’s check some of the amazing tasks copilot can perform and know its potential .
In order to let copilot suggest you code, you need give what are your exact requirements through comments. The below example is about creating a class named Person with first name, last name as a property and greet as a method. So I described the above scenario and now it fully predicted functional code.
Tab key to accept the solution
It also created object from the class with first-name and last-name
And it’s as simple as that, this is just a simple example it can do more complex tasks.
Some more examples
Let’s start interviewing copilot :)
I picked 10 questions from the following websites
Note: It predicts the answer line by line, as every line prediction can’t be shown, i have showed the final output.
2.What are global variables? How are these variable declared?
4. Explain “this” keyword in detail.
5. Explain in detail about == and ===
In my opinion it pretty much explained all the basic questions accurately. But it gave single line answers and one short example, it’s cant predict in-depth answers
6. What is Object Destrcturing?
9. What is the rest parameter and spread operator?
In my opinion, It answered all the questions accurately but it still lacks in depth explanation. So now you may have realized why one liners don't work in an interview, so try taking your answer as deep as possible. One more thing i like about copilot while predicting answers is it backed it’s statement by an example which is appreciable and tells more about the answer, so try giving more examples in any interview.
Though this interview experiment is for fun, giving interviews is not the expertise of copilot, the main service/motto of copilot is to help developers in their day to day coding tasks and make developer experience better. From analyzing all the tasks it has been doing, it’s evident that it succeeded and has been helping the developers to write better code. I personally loved it and i am waiting for more updates.
That’s it for the article, thank you for reaching the end 🙌, hope you enjoyed it. If you liked the article don’t forget to give a clap :)