Ai Coding Tools

How to Use GitHub Copilot to Write Your First 10 Lines of Code in Under 30 Minutes

By BTW Team4 min read

How to Use GitHub Copilot to Write Your First 10 Lines of Code in Under 30 Minutes

If you're a beginner trying to learn how to code, the prospect of writing your first lines of code can feel daunting. You might be wondering, "Where do I even start?" Well, in 2026, tools like GitHub Copilot have made it easier than ever. With the right approach, you can write your first 10 lines of code in under 30 minutes. Let’s dive into how you can leverage GitHub Copilot effectively.

What is GitHub Copilot?

GitHub Copilot is an AI-powered coding assistant that helps you write code faster and with fewer errors. It suggests whole lines or blocks of code based on the context of what you're writing. Think of it as your coding partner who’s always ready to jump in with a suggestion.

Pricing Breakdown

  • Free Trial: 14 days
  • Individual Plan: $10/month
  • Business Plan: $19/user/month

Best for: Individuals and teams who want to streamline their coding process. Limitations: It may not always produce the best code or understand complex contexts.

Prerequisites

Before we get started, make sure you have the following:

  1. GitHub Account: Create a free account at GitHub.
  2. Code Editor: Install Visual Studio Code (VS Code) – it's free and widely used.
  3. GitHub Copilot Extension: Install the GitHub Copilot extension in VS Code.

Step-by-Step Guide to Writing Your First 10 Lines of Code

1. Set Up Your Environment (5 minutes)

  • Install Visual Studio Code: Download and install it from here.
  • Install GitHub Copilot: Open the Extensions view in VS Code and search for "GitHub Copilot." Click "Install."

2. Create a New File (2 minutes)

  • Open VS Code.
  • Click on "File" > "New File" and save it as hello.js (or any other language you’re interested in).

3. Start Coding (15 minutes)

Now, let’s write some simple code. Start typing a comment about what you want to do. For example:

// This is a simple program to greet the user

As you type, Copilot will suggest code. Accept its suggestion by pressing Tab. You can also ask it to generate a function:

// Function to greet the user
function greet(name) {

Once you type the opening brace {, Copilot will suggest the rest of the function. Accept it and your code might look like this:

function greet(name) {
    console.log("Hello, " + name + "!");
}

4. Complete Your Code (5 minutes)

Add the following lines to call the function:

greet("World");

Your final code should look like this:

// This is a simple program to greet the user
function greet(name) {
    console.log("Hello, " + name + "!");
}
greet("World");

5. Run Your Code (3 minutes)

  • Open the terminal in VS Code (Ctrl + backtick).
  • Run the command: node hello.js (make sure you have Node.js installed).

You should see the output: Hello, World!.

Troubleshooting Common Issues

  • Copilot isn’t suggesting code: Make sure you’re typing relevant comments or code snippets. Copilot works best when it has context.
  • Error running the code: Double-check for syntax errors or ensure you have the right runtime environment set up.

What's Next?

Now that you’ve written your first lines of code, consider exploring more complex functions or even different programming languages. Use GitHub Copilot to assist you along the way.

Tools and Resources to Explore

While GitHub Copilot is a fantastic tool, here are some alternatives and complementary tools you might consider:

| Tool Name | Pricing | Best For | Limitations | Our Take | |-------------------|------------------------|-----------------------------------------|-----------------------------------------------|-----------------------------------| | TabNine | Free + Pro at $12/mo | Autocompletion for multiple languages | Less effective in context than Copilot | We use this for quick suggestions. | | Replit | Free + Pro at $7/mo | Collaborative coding | Limited features in the free version | Great for collaborative projects. | | Codeium | Free | AI code completion | Still in beta, can be buggy | We don’t use it yet, but watching. | | Sourcery | Free + Pro at $12/mo | Python code improvement | Focused only on Python | Useful for Python developers. | | Kite | Free + Pro at $16.60/mo | Python and JavaScript autocompletion | Limited to specific languages | We use this for Python projects. |

Conclusion

In just under 30 minutes, you can write your first 10 lines of code using GitHub Copilot. This tool not only helps you reduce the friction of starting but also provides valuable suggestions that improve your coding skills over time.

Start Here: If you're new to coding, set up GitHub Copilot in VS Code and follow the steps above. You'll be amazed at how quickly you can produce working code.

Follow Our Building Journey

Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.

Subscribe

Never miss an episode

Subscribe to Built This Week for weekly insights on AI tools, product building, and startup lessons from Ryz Labs.

Subscribe
Ai Coding Tools

How to Automate Your Development Workflow with AI in 3 Easy Steps

How to Automate Your Development Workflow with AI in 3 Easy Steps (2026) As indie hackers and solo founders, we often find ourselves buried under a mountain of repetitive tasks tha

Sep 3, 20264 min read
Ai Coding Tools

How to Boost Your Coding Velocity with AI in 30 Minutes

How to Boost Your Coding Velocity with AI in 30 Minutes As a solo founder or indie hacker, you know that time is your most precious resource. The idea of boosting your coding veloc

Sep 3, 20264 min read
Ai Coding Tools

Why Most Developers Get GitHub Copilot Wrong: 5 Myths Busted

Why Most Developers Get GitHub Copilot Wrong: 5 Myths Busted As we dive into 2026, GitHub Copilot has become a staple in many developers' toolkits. However, despite its popularity,

Sep 3, 20263 min read
Ai Coding Tools

How to Use AI Coding Tools to Boost Productivity in Under 2 Hours

How to Use AI Coding Tools to Boost Productivity in Under 2 Hours As indie hackers, we all know the struggle of trying to stay productive while juggling multiple projects. The prom

Sep 3, 20265 min read
Ai Coding Tools

Vercel vs GitHub Copilot: Which AI Tool is Right for Your Project?

Vercel vs GitHub Copilot: Which AI Tool is Right for Your Project? As a solo founder or indie hacker, choosing the right tools can be a makeorbreak decision for your project. With

Sep 3, 20263 min read
Ai Coding Tools

Why GitHub Copilot is Not the Magic Bullet for Every Programmer: Debunking the Myths

Why GitHub Copilot is Not the Magic Bullet for Every Programmer: Debunking the Myths As a programmer, I’ve been there: staring at a blank screen, hoping for a burst of inspiration

Sep 3, 20264 min read