If you’ve been coding for a while, I’m sure you already heard of rubber duck debugging. Explaining your code to someone (or in this case a rubber duck) can help tremendously in finding and understanding flaws in it. It can be even better if you have somebody else to talk it through with, since they can share their own ideas with you, or if developing a new feature, they can even have a much easier way of implementing it than you previously thought. That is the whole point of pair programming – two people working together to plan and develop pieces of code overseeing the others’ work.
If you used this method already and switched back to coding alone after, you might miss those thoughts and ideas that popped up while you were hard focused on a line of code. This is where the newest solutions I’ll be writing about come in handy. Nowadays there are new AI pair programmers popping up all around the internet. Amazon just introduced CodeWhisperer a few weeks ago to compete with GitHub’s tool, Copilot.
GitHub released Copilot in 2021, and made it generally available late June of 2022. Copilot can help in a variety of situations. It’s a tool that completes code intelligently, similar to how the GPT-3 model of OpenAI can predict the next word in sentences, or even complete them. It’s basically autocomplete on steroids. A lot of them. There are many times you google even the most basic stuff after years of developing. Copilot can almost completely eliminate this and save you a lot of time.
You don’t remember the name of a built-in function? It doesn’t matter, Copilot will use the context of your work and there is a really high chance it will recommend just that exact piece of code you need.
You need to return every second element from an array of numbers but only if they are even? It might be easy to code, but its even easier to just tell Copilot to do it. It even helps you in writing comments that you will use to tell it what to do. (Which scares me a bit sometimes…) In the pictures below, you can see it in action. I didn’t write a single line of code, only the comments. You might also notice that I didn’t even have to finish the first comment, it autocompleted the comment itself.



