DEV Community


Posted on

GitHub Copilot as the perfect wingman for occasional programming sessions

Many modern games, especially those high-budget, praised in press and gaming communities AAA ones, have quite complex gameplay and controls. Usually you get a gentle introduction to them when start playing. First you just move around, then learn some jumping, basic attacks and later presented with more complex mechanics for casting, crafting, and other fun things.

Same happens with the story and related quests. You learn about the game world, its characters and goals you have. Lots of interesting and sometimes complicated things happen around!

The experience is great when you are really into video games and can afford to play regularly. But what happens if you don’t have such possibility and play occasionally, for example on weekends? This:

Image description

Source: GAMINGbible

You feel lost. You obviously know how to move, but doing something more complex like a proper attack becomes a challenge. If it’s some kind of a story-driven adventure/RPG, you might be in a state when you don’t remember what to do next, and why you need to complete one quest or another.

I often find myself in such frustrating situation and it turns out there is a very similar case with programming for me. I thought that it’s just some rare kind of mental peculiarity, but it looks like that at least for games, the problem is quite frequent:

Talking about programming. Now I work as a manager, and have not coded anything at work for a few years. Occasionally, I get an idea of a pet project that I want to try developing or find an online hackathon and need to get back to the development after a long pause.

The last few times I attempted to write an app, I was feeling exactly like these unfortunate guys from Gravity Falls:

There was an additional challenge as I tried using the technologies or languages I’m new to. But even taking this novelty into account, I still felt that sometimes the work was just too difficult. Even simple things like “how to navigate across screens” or “how to send request and parse response with complex object from server” required googling, then seeing error messages and debugging them (sometimes with additional googling in the process). Of course I was able to get the result, but the progress was painfully slow and it demotivated to continue.

In this matter, hobby programming looks similar to video games for me. If you’ve got a regular practice in a language, you can write compilable code even on a piece of paper. But if not, then almost every attempt to write something leads to being stuck on a ridiculous problem and spending embarrassingly much time on solving it.

This post could be just a useless rant about difficult life, but a couple of weeks ago I started a trial of GitHub Copilot. Initially, I was a little bit skeptical of it, seeing people describe it as improved auto-complete on the Internet.

But then I installed the extensions (I use Rider and VSCode for C# and Flutter respectively) in hopes to make my new pet project development easier.

By the way, it’s a new revolutionary AI-powered social networking app. Not as revolutionary as IRL, but I hope it will be fun to use for some people. The world obviously needs more social networks and creating something new without adding AI nowadays is just pointless.

I read the prompting guide for useful tips and started working with the new tool. And… It turns out this was the exact thing I needed! Now, if I hesitate in the editor for a moment thinking how to write that arrow function, it magically appears by itself! Sometimes the suggested code exactly matches what I would write even without obvious hints around. Such moments make me doubt if I am in possession of imagination and free will, but that’s another topic to discuss.

And besides auto completion that now works significantly better than anything I tried before, the prompting can generate a new file with a simple working code, for example a Flutter widget. This code takes the context from the surrounding files and solves the pain of extending a typical boilerplate with what is needed.

There is obviously space for improvement for Copilot. But working with it for a week or so on my pet project made the experience faster and more pleasant. I’m happy with the progress even despite not so much time spent on it.

For those few who have not tried it yet, I definitely recommend to give a chance to GitHub Copilot.

Let’s now wait for Microsoft to include such a smart assistant for Xbox, and make sure people who play rarely don’t feel lost when trying to play a game once in awhile.

Top comments (0)