Ai Coding Tools

How to Use GitHub Copilot to Write Your First Lines of Code in Under 2 Hours

By BTW Team3 min read

How to Use GitHub Copilot to Write Your First Lines of Code in Under 2 Hours

If you’re a newbie coder trying to dip your toes into the world of programming, the thought of writing your first lines of code can be intimidating. You might wonder if you’re cut out for this. Enter GitHub Copilot—an AI-powered coding assistant that can help you navigate through your first coding challenges in under 2 hours. In this guide, I’ll share how to leverage Copilot effectively, even if you have zero coding experience.

Prerequisites: What You Need to Get Started

Before diving in, here’s what you’ll need to have set up:

  1. GitHub Account: Free to create and necessary for using Copilot.
  2. Visual Studio Code: The most popular code editor where Copilot operates.
  3. GitHub Copilot Subscription: $10/month or $100/year after a 60-day free trial. You’ll need to activate your subscription to start using it effectively.
  4. Basic Understanding of Programming Concepts: Familiarity with variables, loops, and functions will help but isn't strictly necessary.

Step-by-Step Guide to Write Your First Lines of Code

Step 1: Set Up Your Environment

  1. Create a GitHub Account:

  2. Install Visual Studio Code:

  3. Install GitHub Copilot:

    • Open VS Code, go to Extensions (Ctrl+Shift+X), and search for "GitHub Copilot". Click "Install".

Step 2: Start Coding with GitHub Copilot

  1. Create a New File:

    • Open VS Code, create a new file, and save it with a .js or .py extension (JavaScript or Python are great starting languages).
  2. Begin Typing:

    • Start by typing a simple comment like // This function adds two numbers or # This function adds two numbers. Copilot will suggest a function right away. Accept the suggestion by pressing the "Tab" key.
  3. Experiment with Prompts:

    • Try typing different prompts like function to calculate factorial or function to check if a number is prime. Copilot will generate code snippets based on your input.

Step 3: Run Your Code

  1. For JavaScript:

    • You can run your code directly in the terminal within VS Code by using Node.js. Install Node.js if you haven't yet.
  2. For Python:

    • You can run Python code using the terminal or the built-in debugger in VS Code.

Step 4: Troubleshooting Common Issues

  • Issue: Copilot doesn’t suggest anything.

    • Solution: Ensure that you’re connected to the internet and that Copilot is enabled in your settings.
  • Issue: Generated code has errors.

    • Solution: Use the error messages to learn. Fixing errors is a crucial part of the coding process.

What Could Go Wrong

  • Misunderstanding Code: Copilot might generate code that seems correct but isn't optimal or secure. Always review and learn from what it produces.
  • Over-reliance on Suggestions: While Copilot is powerful, you should also strive to understand the code you’re writing and not just copy it blindly.

What's Next?

Once you’ve successfully written your first lines of code, consider:

  • Building a Small Project: Use Copilot to help you create a simple web application or script.
  • Learning More: Check out online courses or tutorials on platforms like Codecademy or freeCodeCamp to deepen your knowledge.

Conclusion: Start Here

If you're a beginner looking to write code quickly, GitHub Copilot is your best bet. With the right setup and a mindset to learn, you can have your first lines of code written in under 2 hours. Remember, the key is to experiment and learn from the suggestions Copilot provides.

What We Actually Use

In our experience, we use GitHub Copilot for quick prototypes and learning new languages. However, we also complement it with traditional learning methods to build a solid foundation.

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

Cursor vs GitHub Copilot: Which AI Coding Assistant is the Best for 2026?

Cursor vs GitHub Copilot: Which AI Coding Assistant is the Best for 2026? As a solo founder or indie hacker, having the right tools can make or break your productivity, especially

Mar 28, 20263 min read
Ai Coding Tools

Cursor vs Codeium: Which AI Coding Tool is Worth Your Time? A 2026 Comparison

Cursor vs Codeium: Which AI Coding Tool is Worth Your Time? A 2026 Comparison As a solo founder or indie hacker, you're constantly on the hunt for tools that actually enhance your

Mar 28, 20263 min read
Ai Coding Tools

Supabase vs Firebase: The Best AI Coding Tool for Your Project in 2026

Supabase vs Firebase: The Best AI Coding Tool for Your Project in 2026 As a solo founder or indie hacker, choosing the right backend service can feel like navigating a minefield—es

Mar 28, 20264 min read
Ai Coding Tools

Is Codeium Really Worth the Hype? A Deep Dive Comparison with GitHub Copilot

Is Codeium Really Worth the Hype? A Deep Dive Comparison with GitHub Copilot If you're a solo founder or indie hacker, you know the struggle of finding the right tools to superchar

Mar 28, 20263 min read
Ai Coding Tools

Why Codeium Might Be Overrated for AI Development in 2026

Why Codeium Might Be Overrated for AI Development in 2026 As we dive into 2026, the landscape of AI development is more crowded than ever, and tools like Codeium are often touted a

Mar 28, 20264 min read
Ai Coding Tools

Why Most Developers Overrate Codeium: A Critical Analysis

Why Most Developers Overrate Codeium: A Critical Analysis In 2026, the landscape of AI coding tools has exploded, with Codeium frequently touted as a top choice among developers. H

Mar 28, 20264 min read