How To Be 1KX Faster With GitHub Copilot
Tags: github, webdev, programming, productivity
Published: 2022-12-08 18:06:37

If you have never heard about GitHub Copilot, I'm jealous as a friend because, after this article, you will experience the same positive shock I did when I tried it for the first time.

### What is GitHub Copilot?

![1](https://cdn-images-1.medium.com/max/1600/1*k-EtfF4u2LeovDnilx7mUQ.png)

Once upon a time, there was a dog. His name was Copilot, but [GitHub](https://medium.com/u/8df3bf3c40ae) proposed him a raise. And instead of this cuttie ↑, we got this cutie ↓ (write in the comment which one you like more)

![gh-copilot](https://cdn-images-1.medium.com/max/1600/1*iBwh5SWF7QRGAZLyU7_feQ.jpeg)

He not only looks nice but can do magic with your code. Right from your editor, GitHub Copilot uses the OpenAI Codex to suggest code and entire functions in real time. Simply put, he helps you write code faster by learning from your code (and millions of lines of code from other contributors across the web) to predict your next step or give you a snippet from a comment you would provide. You write, "Create a function that generates 1000 random users with images," and the result will be generated instantly.

```typescript
// Create a function that generates 1000 random users with images
import faker from 'faker';

const generateUsers = () => {
    const users = [];
    for (let i = 0; i < 1000; i++) {
        users.push({
            id: i,
            name: faker.name.findName(),
            image: faker.image.avatar(),
        });
    }
    return users;
});

```

Let me show you how it works with a real-world example. Recently, I've got the task to create two screens in [React Native](https://medium.com/u/64c68a690f89) where the first one will conduct a random today joke, and the second will display a list of all previous jokes. All data should be persisted and stored in AsyncStorage. That means, every day, we have to save fetch a new joke, and the current one goes to history. Let's summarize it in terms of actions:

-   For the Today screen, we need to **get a joke from API**
-   Then **save the joke and current date in the AsyncStorage**
-   **Add a checker** for 24-h expiration
-   If expired  -  fetch a new joke
-   **And put** the current one **in the history list in the AsyncStorage**
-   For the History screen, we only need to **get a history of jokes**

Let's see how GitHub Copilot can help us with it.

> I was thinking about GIF format, but with video it's even better and it takes only 1 min

I hope you saw the video and got that positive shock I had. Just imagine how outstanding you will be with this tool by snapping your fingers (or clicking the Tab key).

![2](https://cdn-images-1.medium.com/max/1600/0*0erK0loC6_e6eUV6)

* * * * *

### How much?

Previously, this tool was free. But it's not anymore. So let's talked about pricing.

![3](https://cdn-images-1.medium.com/max/1600/1*BT9rq6u-3bcahMEFksnjjA.png)

Today, December 8th, 2023, costs $10 bucks per month or $100 per year, which is less than I expected.

![4](https://cdn-images-1.medium.com/max/1600/1*-WlJU0luBET7xcPbv3SALg.png)

But there's some good news; you don't have to pay in advance. Start a free trial, test it, taste it, and decide if it is something you want in your personal arsenal.

* * * * *

I hope the article was helpful. Please subscribe so you don't miss the following article, and feel free to contact me if you have any questions.

[Twitter](https://twitter.com/kucherenko_web) | [LinkedIn](https://www.linkedin.com/in/sergey-kucherenko/)