Ai Coding Tools

How to Use GitHub Copilot to Write Your First Program in 30 Minutes

By BTW Team3 min read

How to Use GitHub Copilot to Write Your First Program in 30 Minutes

If you’re a solo founder or an indie hacker, you probably know that coding can feel like a daunting task. Learning to program can take weeks or even months, but what if I told you that with GitHub Copilot, you could write your first program in just 30 minutes? Yes, it sounds ambitious, but with the right approach, it's totally achievable. In this guide, I’ll walk you through the steps to get started with GitHub Copilot and write a simple program, all while keeping it practical and straightforward.

Prerequisites: What You Need Before You Start

Before diving in, there are a few things you'll need to set up:

  1. GitHub Account: Sign up for a free account if you don’t have one already.
  2. Visual Studio Code: Download and install Visual Studio Code, which is a free code editor.
  3. GitHub Copilot Subscription: GitHub Copilot costs $10/month after a 60-day free trial. Make sure to activate it within VS Code.
  4. Basic Understanding of Programming: While Copilot can assist you, having some foundational knowledge will help you understand the code it generates.

Step 1: Setting Up GitHub Copilot

  1. Install the Extension:

    • Open Visual Studio Code.
    • Go to the Extensions view by clicking on the Extensions icon in the Activity Bar.
    • Search for “GitHub Copilot” and click “Install”.
  2. Sign In:

    • After installation, you’ll be prompted to sign in to GitHub. Follow the on-screen instructions to authorize Copilot.
  3. Activate Copilot:

    • Once signed in, activate GitHub Copilot by clicking on the Copilot icon in the sidebar.

Step 2: Writing Your First Program

Let’s create a simple program that adds two numbers together. Here’s how to do it:

  1. Create a New File:

    • In VS Code, create a new file and name it add_numbers.py.
  2. Start Coding:

    • Type a comment to describe what you want to do. For example:
      # This program adds two numbers
      
  3. Let Copilot Assist You:

    • Start coding the function by typing:
      def add_numbers(a, b):
      
    • Wait for Copilot to suggest the next lines of code. You should see a suggestion pop up. Press Tab to accept it.
  4. Complete the Program:

    • Add a few lines to call your function and print the result:
      print(add_numbers(5, 3))
      
    • Accept any suggestions Copilot provides to complete the program.
  5. Run Your Program:

    • Open your terminal in VS Code and run the command:
      python add_numbers.py
      
    • You should see the output 8.

Troubleshooting: What Could Go Wrong

If you encounter issues, here are some common pitfalls:

  • Copilot Doesn’t Suggest Code: Ensure you’re connected to the internet and that your GitHub Copilot subscription is active.
  • Errors in Code: Double-check the syntax. Copilot can make mistakes, so it’s good practice to understand what the code is doing.
  • VS Code is Slow: Sometimes, extensions can slow down your editor. Try disabling other extensions to see if performance improves.

What’s Next?

Now that you’ve written your first program, consider the following steps:

  • Explore More Features: Try writing different functions or creating a small project. Use Copilot to assist you in learning new programming concepts.
  • Join a Community: Engage with other builders who are learning to code. Platforms like Discord or Reddit can be invaluable.

Conclusion: Start Here!

Using GitHub Copilot can drastically reduce the time it takes to start coding. In just 30 minutes, you can write a simple program and gain confidence in your coding abilities. Just remember to keep learning and exploring as you go.

If you’re ready to dive deeper into programming, GitHub Copilot is a tool worth investing in, especially with its affordable pricing of $10/month after the trial.

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

10 Common Mistakes New Coders Make When Using AI Tools

10 Common Mistakes New Coders Make When Using AI Tools As a new coder, diving into the world of AI tools can feel like both a blessing and a curse. On one hand, these tools can mas

Apr 7, 20265 min read
Ai Coding Tools

How to Increase Your Coding Speed by 30% with AI Tools in 2 Weeks

How to Increase Your Coding Speed by 30% with AI Tools in 2026 If you’re a solo developer or indie hacker, you know the struggle of balancing coding with all the other tasks that c

Apr 7, 20264 min read
Ai Coding Tools

Top 5 Advanced AI Coding Tools for Expert Developers in 2026

Top 5 Advanced AI Coding Tools for Expert Developers in 2026 As an expert developer in 2026, you're likely familiar with the frustration of navigating through endless lines of code

Apr 7, 20264 min read
Ai Coding Tools

Cursor vs. GitHub Copilot: Which AI Coding Tool Gives You Better Code Suggestions?

Cursor vs. GitHub Copilot: Which AI Coding Tool Gives You Better Code Suggestions? (2026) As a solo founder or indie hacker, finding the right coding tool can feel like searching f

Apr 7, 20263 min read
Ai Coding Tools

Why Most Developers Find AI Coding Tools Overrated

Why Most Developers Find AI Coding Tools Overrated As we dive into 2026, you might think that AI coding tools have become the holy grail for developers looking to boost productivit

Apr 7, 20264 min read
Ai Coding Tools

The Myth of AI Coding Tools: 5 Misconceptions Debunked

The Myth of AI Coding Tools: 5 Misconceptions Debunked As we dive deeper into 2026, the rise of AI coding tools has sparked a whirlwind of excitement and skepticism among indie hac

Apr 7, 20264 min read