#GitHub – 1st experiences with 🤖 #GitHubCopilot ⭐⭐⭐⭐⭐

Hi !

I was lucky enough to get access to the preview of GitHub Copilot, and I’ll rate my experience so far ⭐⭐⭐⭐⭐.

Let’s start from the beginning, sharing the official definition:

GitHub Copilot

Your AI pair programmer
With GitHub Copilot, get suggestions for whole lines or entire functions right inside your editor.

GitHub Copilot

I won’t write about Codex, GPT3, OpenAI, etc.; I’ll focus on my experience as a programmer using the tools.

So, 1st feedback:

You need to have a special mindset to work with CoPilot. I mean, you have suggestions all the time, it may interrupt your coding flow, however, once you get this mindset, is a super cool experience.

And, what’s is this ? Let’s take a look at the “Hello World” on copilot, add 2 numbers. As you can see in the video below, a couple of interesting threads are happening here:

  • I get a suggestion for the function before I close the “(“, and that function includes parameters.
  • Once I get a suggestion, I can also review other suggestions. It may make sense or not, programmers choice.
  • OK, so I closed my parenthesis in the function “()”, no parameters. Copilot will ask for these 2 numbers to perform the Add. How cool is this !
  • And again, I got several options for this function.
copilot addtwonumbers

And, how about a more complex Hello World, using 4 numbers

  • Like before, CoPilot suggests 2 different versions for the function with parameters. Nice detail here, both options are the same.
  • And in a function without parameters, CP also suggest several ways to perform this.
copilot addfournumbers

How about real scenarios ? helping with day to day tasks?

So, I’ve been working with threads for +20 years. However, in C# and Python I always need to search for the right syntax for this. Let’s take a look at this.

  • The code start with a dummy function performAction(). That’s the function that I want to run in a thread.
  • Instead of writing code, I’ll write my goal in a comment. Yes, programmers writing comments !!!
  • CP suggest line 7: run performAction() on a new thread. Important, I already have the using as part of the Python file.
  • CP suggest line 8: start the thread. And line 9 if we want to join threads. Not today CP, not today!

Now, this becomes handy and useful. Again, that’s my experience in a couple of days using this, mostly to update my Drones and TinyML demos. So far so good.

Bonus: Take a look at code generating in SPANISH !

copilot sumar dos numeros

Happy coding!

Greetings

El Bruno

More posts in my blog ElBruno.com.

More info in https://beacons.ai/elbruno



¿Con ganas de ponerte al día?

En Lemoncode te ofrecemos formación online impartida por profesionales que se baten el cobre en consultoría:

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.