Burak Acar is a software enthusiast and a passionate blogger. He holds a Bachelor’s degree in Computer Engineering and is continually seeking to deepen his knowledge in fields such as artificial intelligence and software development. Through his blog, Burak shares his learning journey with others, breaking down complex topics into comprehensible pieces. He believes in the importance of lifelong learning and the power of sharing knowledge, and this belief fuels his writing. You can follow along with Burak’s journey and engage with his content on LinkedIn, Twitter, and his Medium”
https://medium.com/@nburakacar
https://www.linkedin.com/in/burak-acar/
https://twitter.com/iamburakacar
Your AI pair programmer
Is artificial intelligence a threat to programmers or a boon? Let’s take a deeper look at Github Copilot, our next-generation coding companion, which combines OpenAI’s “GPT-3” artificial intelligence with Github’s public repos.
“Trying to code in an unfamiliar language by googling everything is like navigating a foreign country with just a phrase book. Using GitHub Copilot is like hiring an interpreter.” — Harri Edwards // OpenAI
Github copilot is a coding helper powered by artificial intelligence that was launched on June 29, 2021. You may have heard of OpenIA’s “GPT-3” technology, which is considered the most advanced level of artificial intelligence. When this technology originally came out, it was capable of natural language processing, but what if it was trained with a dataset comprising billions of lines of code and samples from all languages used in the software development world, notably Github repositories? The greater the data collection, or the resource from which it may learn, the more consistent the forecasts will be, like with any artificial intelligence. Python, JavaScript, TypeScript, Ruby, Java, and Go are excellent at technical preview, but they can also grasp dozens of languages and assist us in practically every situation.
Let’s have a look at how it functions and what it offers.
“In the first day, GitHub Copilot already taught me about a nuance in Javascript object comparison and is as comfortable with our database schema as I am. This is the single most mind-blowing application of ML I’ve ever seen.” — Mike Krieger // Co-founder, Instagram
Programmers devote a significant amount of effort to developing code and resolving issues. Code editors, syntax recommendations, snippets, debugging advice, and other tools are available. What if we had a tool that employed artificial intelligence (AI) to assist us in writing far more critical code sections? That’s what GitHub Copilot is for.
To summarize, GitHub Copilot is an artificial intelligence (AI) application that generates code suggestions based on comments and the context of the file you’re working. Yes, it proposes the suitable code for the file, that is, for your writing style and project, and it attempts to find the right one for you rather than the most accurate one.
"I
t surprised me with how precisely it understood my comment and generated accurate suggestions. The ability to choose from 10 different suggestions was the cherry on top.” — Gunnika Batra
The GPT-3 model’s builder Codex is powered by an AI system that constructs.
The Generative Pre-Trained Transformer (GPT-3) is a language model that can generate text strings from simple prompts. Codex is based on this concept, which generates not just text but also code in a number of popular languages. This is where you’ll find the majority of components, hardware, and other services from across the world.
Copilot is trained with billions of lines of code from public GitHub repositories, thus your code has most likely enhanced this AI tool in some manner. If you have a public Github repo and are writing there, kudos. It is because of you that Copilot exists.
I wanted to see how GitHub Copilot works and what it can do on Java right now. You can access the entire code on my github website, and if you get stuck, you can contact me.
For the time being, you may add it as an add-on to Visual Studio Code, JetBrains, and Neovim, and then log in with your Github account to access the technical preview stage.
Based on the context of the file you’re working, GitHub Copilot produces several suggestions for you. It mostly makes suggestions based on the comments you’ve added to the file and the code you’ve written before.
When the Co-Pilot suggests a code, it will prompt you to utilize it. Let’s put Copilot to the test by designing a function that estimates a dataset’s mean. All I have to do now is provide Copilot a remark and the function’s name.
So what if we don’t like the way this writer writes? The recommendation box that displays when we enter the main page of copilot also provides several options for this operation. It is entirely up to you to make your decision.
Fibonnaci, prime number identification, operations on strings, palindrome, and fizz buzz are some simple algorithmic questions that every software developer encounters from time to time.
Why don’t you try out any of these algorithms?
You’re familiar with the FizzBuzz problem, but for those who aren’t, let me explain it again. This example came straight from a python test, and I’m delighted it’s written in java as well. As I told AI in our challenge, the function takes an integer and displays “Fizz” on the screen if it is divisible by 3, “Buzz” if it is divided by 5, and “FizzBuzz” if it is divisible by both. If none of the requirements are met, we print our article on the screen.
Take a look at the code below; it’s basic, but isn’t it wonderful that he can create it himself with my suggestions?
Let’s put it to the test on a new scenario. Let’s say we have a string value and want to insert a ‘x’ in every place where any letter appears in it. Let’s see how he responds.
He didn’t get me on the first try, I think. In such circumstances, it provides you with a variety of alternatives.
You could question whether the programming is only being worked on, but it isn’t. You may also use javascript scripts or spring to create services. Let’s say we want to print a test for the code we just typed.
Again, he didn’t offer the best idea straight away, but he did demonstrate his ability to write a unit test. Let’s go through the alternatives for the right test and perform it.
Perhaps we can ask it to calculate the value of the 37th prime number or to get the 17th Fibonacci sequence element.
Recursively, it presents a code that allows us to locate any element of the Fibonnaci sequence. Of course, accepting these ideas as absolute truth isn’t wise, but you can’t deny that this code was derived from an examination of the code you created and the structures utilized in general.
Let’s look at one more conclusive case. Let’s see how it works with binary search.
Do you know what the code means? Don’t worry if you don’t comprehend right away since I didn’t either. Aside from that, the preceding technique is perhaps the finest in Github.
In fact, one of the first and most serious drawbacks emerges right here. Given that this code is still in the testing phase, it appears that the best answer is to evaluate the code once it has been generated and determine if it performs as expected.
Apart from these features, I can’t help but say that he can communicate with you. You may not believe he’s talking to you, but he is. This is a feature from natural language processing that I specified in GPT-3. Join the test version for a more detailed discussion. When I queried its name in java class it replied as function.
I believe that a broad review is required.
First and foremost, it’s a lot of fun to use, and it appears to be ready to show you what it can accomplish. I’ll admit that I wondered for hours if he could achieve that or write something like this.
I’m not sure if using it in a huge project makes sense, and it might not make sense to use it while it’s still in the testing phase.
I can say that it works a bit slow for now, at this development stage sometimes it may cause you to wait instead of typing what you know quickly, but it does not have that serious effect. Apart from that, it can sometimes experience interruptions, which is quite normal these days when the development process continues, but it can give you a hard time when it comes back and forth. You don’t know when to think and when not to think.
“GitHub Copilot discovered that a test file I was working in was missing a specific test and suggested and wrote the test for me.” — Kate Studwell // GitHub
Aside from that, as we can see from the examples I provided above, it does not always provide the best recommendation the first time. Apart from that, owing to the length of the function, it may provide the proposal piecemeal, raising concerns about when it will be completed and if the final version will perform effectively.
Apart from these little flaws, I can say that it is an incredible technical advancement that continues to astonish him. When incorporating it into your software development process, you should pay attention to the dependence. It generates programs that are extremely legible and intelligible.
“I’m impressed by how GitHub Copilot seems to know exactly what I want to type next. GitHub Copilot is particularly helpful when working on React components, where it makes eerily accurate predictions. GitHub Copilot has become an indispensable part of my programmer toolbelt.” — Feross Aboukhadijeh
Leaving all of that aside, the utilization of public github repositories in this development process has sparked criticism from certain developers. As you may be aware, most open source licenses (GNU, BSD, APACHE, and so on) allow for development, modification, and distribution as long as the license is followed. However, according to the information on the Github Copilot website, if this procedure is finished successfully, it will be released as a commercial product, which would produce cash.
Note that TabNine, another AI code completion program, is also trained on open source code from GitHub, so this doesn’t appear to be a significant shift. This tool is still in technical preview, which means it can export personal data from GitHub repositories, but we can wait till this problem is rectified before releasing it.
As a result, it is widely assumed that AI models would be trained using a broad set of data. However, ethical questions surrounding this procedure will be a hot topic of discussion in the next years.
In the face of an amazing technology whose development is unknown, I am in awe. The world is changing, and software development technology is evolving as well. I hope software developers will continue to exist in the future. I’ll see you later.
Reference:
Acar, B. (2023). What is GitHub Copilot? Available at: https://nburakacar.medium.com/what-is-github-copilot-f66bdaa6f44d [Accessed: 25th September 2023].