Ai Coding Tools

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

By BTW Team3 min read

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

If you’re a beginner looking to dip your toes into coding, GitHub Copilot could be a game-changer for you. But let’s be honest: diving into coding can feel overwhelming, especially when you’re staring at a blank screen. The good news? You can write your first 10 lines of code in just 30 minutes using Copilot, and I’m here to walk you through it.

Prerequisites: What You Need to Get Started

Before you start, make sure you have the following:

  1. A GitHub Account: If you don’t have one yet, sign up for free at GitHub.
  2. Visual Studio Code (VS Code): Download and install it from here.
  3. GitHub Copilot Subscription: It costs $10/month after a 60-day free trial. You can sign up directly in VS Code after installation.

Step 1: Set Up Your Environment (5 Minutes)

  1. Open Visual Studio Code.

  2. Install the GitHub Copilot Extension:

    • Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window.
    • Search for "GitHub Copilot" and click "Install."
  3. Log into GitHub:

    • After installation, you’ll need to log in to your GitHub account through the extension.

Step 2: Create a New File (5 Minutes)

  1. Create a New File:

    • Click on File > New File or press Ctrl + N.
    • Save the file with a .js extension (e.g., hello.js).
  2. Start Typing:

    • Begin by typing a simple comment like // This program prints "Hello, World!". Copilot will automatically suggest code based on your comment.

Step 3: Let Copilot Do Its Magic (10 Minutes)

  1. Type Your Intent:

    • After the comment, type console.log( and let Copilot fill in the rest. You should see suggestions pop up. Hit Tab to accept the suggestion.
  2. Write Additional Lines:

    • To create a simple program, you can type:
      // This program adds two numbers
      const a = 5;
      const b = 10;
      console.log(a + b);
      
  3. Review and Modify:

    • Make sure to review the generated code. You can modify it to fit your needs or preferences. Copilot is great, but it's not perfect.

Expected Output

After following the steps, your hello.js file should look something like this:

// This program prints "Hello, World!"
console.log("Hello, World!");

// This program adds two numbers
const a = 5;
const b = 10;
console.log(a + b);

Troubleshooting: What Could Go Wrong

  • No Suggestions: If you don’t see any suggestions from Copilot, make sure the extension is properly installed and you are connected to the internet.
  • Inaccurate Code: Sometimes, Copilot may generate code that doesn't work as expected. Always run your code to check for errors.

What’s Next?

Once you’ve successfully written your first 10 lines of code, consider the following steps:

  1. Experiment: Modify the numbers or add more console logs to get familiar with coding concepts.
  2. Learn More: Check out online resources or courses on JavaScript to expand your knowledge.
  3. Join Communities: Engage with other beginners on forums like Stack Overflow or Reddit’s r/learnprogramming.

Conclusion: Start Here

If you’re a beginner, GitHub Copilot is a fantastic tool to help you get started with coding. With just 30 minutes and a few simple steps, you can write your first lines of code and see how coding works in practice. Don’t hesitate to explore and experiment—coding is all about learning through doing.

To get the most out of Copilot, remember that it’s a tool to assist you, not replace fundamental learning. As you grow more comfortable with coding, you’ll find that understanding the underlying concepts will make you a much better developer.

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 Boost Your Coding Skills with AI Assistants in Just 30 Minutes

How to Boost Your Coding Skills with AI Assistants in Just 30 Minutes As a solo founder or indie hacker, finding time to improve your coding skills can feel impossible. You’re jugg

Jun 27, 20264 min read
Ai Coding Tools

GitHub Copilot vs Codeium: Which Delivers Better Results for Indie Hackers?

GitHub Copilot vs Codeium: Which Delivers Better Results for Indie Hackers? As indie hackers, we’re always on the lookout for tools that can save us time and help us ship faster. E

Jun 27, 20263 min read
Ai Coding Tools

Best 5 AI Coding Tools for Freelance Developers in 2026

Best 5 AI Coding Tools for Freelance Developers in 2026 As a freelance developer in 2026, you're juggling multiple projects, deadlines, and client expectations. The right tools can

Jun 27, 20264 min read
Ai Coding Tools

How to Boost Your Coding Speed by 50% with AI Tools in 2026

How to Boost Your Coding Speed by 50% with AI Tools in 2026 If you’re like most indie hackers or solo founders, you’ve probably felt the pressure to ship faster while maintaining c

Jun 27, 20264 min read
Ai Coding Tools

Why GitHub Copilot Isn't the Ultimate Solution for All Your Coding Needs

Why GitHub Copilot Isn't the Ultimate Solution for All Your Coding Needs As a solo founder or indie hacker, you might be tempted to think that GitHub Copilot is your golden ticket

Jun 27, 20264 min read
Ai Coding Tools

The 10 Best AI Coding Tools for Full-Stack Developers in 2026

The 10 Best AI Coding Tools for FullStack Developers in 2026 As a fullstack developer in 2026, you’re likely feeling the pressure of rapid technological changes and the need to sta

Jun 27, 20265 min read