Ai Coding Tools

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

By BTW Team4 min read

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

If you're just starting out on your coding journey, the thought of writing your first lines of code can be intimidating. I remember my first attempt—sitting there, staring at a blank screen, wondering where to begin. Fast forward to 2026, and tools like GitHub Copilot have changed the game for beginners. With its AI-powered suggestions, you can write your first 100 lines of code in just about two hours. Let’s break down how to effectively use GitHub Copilot to get you coding quickly and efficiently.

Prerequisites: What You Need Before Getting Started

Before you dive in, you’ll need a few things:

  1. GitHub Account: Sign up for free at GitHub.
  2. Visual Studio Code: Download and install this code editor, which is free and widely used.
  3. GitHub Copilot Subscription: It costs $10/month after a 30-day free trial. This is necessary to access Copilot's features.
  4. Basic Understanding of Programming: Familiarity with concepts like variables and functions will help, but you can still follow along as a complete beginner.

Step 1: Setting Up Your Environment

  1. Install Visual Studio Code: Go to the Visual Studio Code website and download the appropriate version for your operating system.

  2. Install the GitHub Copilot Extension: Open Visual Studio Code, navigate to the Extensions view (Ctrl+Shift+X), and search for "GitHub Copilot." Click "Install."

  3. Log in to GitHub: Once the extension is installed, you’ll need to log in to your GitHub account to activate Copilot.

Expected Output: After setup, you should see the Copilot icon in the Visual Studio Code sidebar.

Step 2: Writing Your First Lines of Code

  1. Create a New File: Start by creating a new file with a .js extension for JavaScript (or any language you prefer).

  2. Start Coding: Type a simple comment or a function name. For example, you might write // Function to calculate the sum of two numbers and hit enter. Copilot will suggest code for you.

  3. Accept Suggestions: If the suggestion looks good, press Tab to accept it. If not, you can keep typing or hit Ctrl+Space to see alternative suggestions.

  4. Iterate: Continue adding comments or function names to guide Copilot. In about 30 minutes, you should have your first 50 lines of code.

Expected Output: You should see a completed function based on your comments.

Step 3: Testing Your Code

  1. Run Your Code: Use the built-in terminal in Visual Studio Code to run your code. If you’re coding in JavaScript, you might use Node.js for execution.

  2. Debugging: If you encounter errors, read the error messages carefully. Copilot can help suggest fixes, but you might need to do a bit of research to understand the error.

Expected Output: Successfully running your code with no errors.

Troubleshooting Common Issues

  • Copilot Not Suggesting Code: Ensure you are logged in and that your file type is supported.
  • Errors in Code: Don't hesitate to look up error messages. Sometimes Copilot’s suggestions need tweaking.
  • No Suggestions for Complex Logic: If Copilot struggles, break down your logic into smaller parts.

What’s Next: Building Upon Your Foundation

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

  1. Explore New Languages: Try Python or Ruby. The process is similar.
  2. Build a Simple Project: Create a small app or game to solidify what you’ve learned.
  3. Join Coding Communities: Engage with fellow beginners on platforms like GitHub or Discord for support and collaboration.

Conclusion: Start Here

Getting started with coding in 2026 has never been easier, especially with tools like GitHub Copilot at your disposal. By following these steps, you can confidently write your first 100 lines of code in just two hours. If you find yourself stuck, remember that coding is a journey—embrace the learning process and keep experimenting!

What We Actually Use

In our experience, GitHub Copilot is a fantastic tool for beginners, but it's not infallible. We use it alongside traditional learning resources like Codecademy and freeCodeCamp to fill in the gaps. While Copilot can suggest code, understanding the underlying concepts is crucial for long-term success.

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 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
Ai Coding Tools

5 Mistakes to Avoid When Using AI Coding Tools for Real Projects

5 Mistakes to Avoid When Using AI Coding Tools for Real Projects As we dive deeper into 2026, AI coding tools have become an essential part of the developer's toolkit. However, usi

Oct 4, 20264 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools and Why They Matter

5 Common Misconceptions About AI Coding Tools and Why They Matter As a solo founder or indie hacker, you’re likely eyeing AI coding tools to boost your productivity and streamline

Oct 4, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make with AI Coding Tools in 2026

5 Common Mistakes Developers Make with AI Coding Tools in 2026 As we dive deeper into 2026, AI coding tools have become essential for developers looking to enhance productivity and

Oct 4, 20263 min read