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

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time As a developer, whether you're just starting out or have years of experience, debugging can feel like a neverend

Oct 16, 20265 min read
Ai Coding Tools

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow As developers, we’re always on the lookout for ways to streamline our workflow and boost productivity. Enter

Oct 14, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools That Could Hurt Your Development Process

5 Myths About AI Coding Tools That Could Hurt Your Development Process As a solo founder or indie hacker, you might be lured by the promises of AI coding tools that claim to simpli

Oct 13, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026 As AI coding tools have become an integral part of a developer's toolkit in 2026, many are still stumbling over

Oct 12, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026 As we dive into 2026, the landscape of AI coding tools has evolved significantly, yet many developers still

Oct 11, 20263 min read
Ai Coding Tools

Why AI Coding Assistants Are Overrated for Beginners in 2026

Why AI Coding Assistants Are Overrated for Beginners in 2026 As a solo founder or indie hacker, it’s tempting to think that AI coding assistants are the silver bullet to jumpstart

Oct 10, 20263 min read