Ai Coding Tools

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

By BTW Team4 min read

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

If you’re new to coding, diving into the world of programming can feel overwhelming. You might think, “Can I really write code that works?” The good news is that with tools like GitHub Copilot, you can get started quickly and effectively. In this guide, I’ll show you how to leverage Copilot to write your first 100 lines of code in under 30 minutes.

Prerequisites: What You Need to Get Started

Before we jump in, let’s cover what you need:

  • A GitHub account: Sign up for free if you don’t have one.
  • Visual Studio Code (VS Code): Download and install it. It’s a popular code editor.
  • GitHub Copilot: You’ll need to subscribe to GitHub Copilot. Pricing starts at $10/month after a free trial.
  • Basic understanding of programming concepts: Familiarity with variables, loops, and functions will help, but it’s not mandatory.

Step 1: Set Up GitHub Copilot in VS Code

  1. Install the GitHub Copilot extension: Open VS Code, go to the Extensions view (Ctrl+Shift+X), and search for "GitHub Copilot". Click on "Install".
  2. Sign in to GitHub: After installation, you’ll be prompted to log into your GitHub account. Follow the authentication steps.
  3. Start a new file: Create a new file in a programming language of your choice (e.g., Python, JavaScript).

Step 2: Write Your First Line of Code

Now, let’s write some code. Start with a simple task, like printing "Hello, World!".

  1. Type print("Hello, World!") and wait for Copilot's suggestion.
  2. If you see the suggestion pop up, you can accept it by hitting the Tab key.

Expected Output:

You should see "Hello, World!" printed in your console when you run the code.

Step 3: Build on Your Code with Copilot

Now that you’ve got your first line, let’s expand. Here’s how to write a simple function that adds two numbers:

  1. Type def add_numbers(a, b): and give Copilot a moment to suggest the function body.

  2. Accept the suggestion, which might look something like this:

    return a + b
    
  3. Next, call your function and print the result:

    result = add_numbers(5, 3)
    print(result)
    

Expected Output:

You should see 8 printed in your console.

Step 4: Create a Simple Loop

Let’s add some complexity with a loop. Type the following code to create a list of numbers and print them:

  1. Start with:
    for i in range(5):
    
  2. Let Copilot suggest the body of the loop, which might be:
    print(i)
    

Expected Output:

You should see the numbers 0 through 4 printed, one per line.

Troubleshooting: What Could Go Wrong

  • No suggestions appearing: Ensure that you’re connected to the internet and that GitHub Copilot is enabled in your settings.
  • Errors in code: If your code doesn’t run, double-check the syntax. Copilot is helpful, but it’s not infallible.

What's Next: Expanding Your Skills

After you’ve written your first 100 lines, consider the following:

  • Explore more complex functions: Try writing functions that handle lists, dictionaries, or even classes.
  • Get familiar with debugging: Learn how to read error messages and fix issues in your code.
  • Join coding communities: Platforms like GitHub, Stack Overflow, and Reddit can provide support and resources.

Conclusion: Start Here

Using GitHub Copilot can significantly speed up your coding journey. By following these steps, you should be able to write your first 100 lines of code in under 30 minutes. Remember, the key is to keep practicing and exploring new coding challenges.

What We Actually Use

We’ve found that GitHub Copilot is a great tool for beginners and even seasoned developers looking for quick suggestions. However, be mindful of its limitations; it sometimes suggests incorrect or inefficient code. Use it as a guide, but always review the output.

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

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back As a solo founder or indie hacker, you might be considering leveraging AI coding tools to boost your produc

Oct 7, 20264 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools That Will Hurt Your Learning

5 Common Misconceptions About AI Coding Tools That Will Hurt Your Learning As a beginner in coding, diving into the world of AI coding tools can feel like stepping into a futuristi

Oct 6, 20263 min read
Ai Coding Tools

10 AI Coding Tools Beginners Overlook in 2026

10 AI Coding Tools Beginners Overlook in 2026 As a beginner in coding, diving into the vast ocean of AI tools can feel overwhelming. While flashy tools often grab the spotlight, ma

Oct 6, 20265 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools That Beginners Believe

5 Common Misconceptions About AI Coding Tools That Beginners Believe As a solo founder or indie hacker, diving into the world of AI coding tools can feel overwhelming, especially i

Oct 5, 20263 min read
Ai Coding Tools

5 Mistakes Every Beginner Makes When Using AI Coding Tools

5 Mistakes Every Beginner Makes When Using AI Coding Tools As a solo founder or indie hacker diving into the world of AI coding tools, it’s easy to get swept up in the excitement o

Oct 4, 20264 min read
Ai Coding Tools

10 Common Misconceptions About AI Coding Tools in 2026

10 Common Misconceptions About AI Coding Tools in 2026 As we dive into 2026, AI coding tools have become a staple in the developer toolkit. However, misconceptions still run rampan

Oct 4, 20264 min read