Ai Coding Tools

How to Write Your First 50 Lines of Code Using GitHub Copilot in 1 Hour

By BTW Team3 min read

Comparing tools? See the AI tools tested on the show.

In short

A step-by-step guide for absolute beginners on how to effectively write your first 50 lines of code with GitHub Copilot in just one hour.

If you're a beginner looking to dive into coding, the thought of writing your first lines of code can be daunting. You might feel overwhelmed by all the syntax, structures, and concepts you need to grasp. But what if I told you there's a way to get started quickly—with the help of GitHub Copilot? In this guide, I'll show you how to write your first 50 lines of code using GitHub Copilot in just one hour.

Prerequisites: What You Need Before You Start

Before you get started, here’s what you’ll need:

  1. GitHub Account: Sign up for a free account if you don’t have one.
  2. Visual Studio Code (VS Code): Download and install this code editor.
  3. GitHub Copilot: Subscribe to GitHub Copilot, which costs $10/month or $100/year for individuals. There’s a free trial available for new users.
  4. Basic Understanding of Programming Concepts: Familiarize yourself with basic programming terms, but don’t stress too much—Copilot will help!

Step 1: Setting Up GitHub Copilot in VS Code

  1. Install the GitHub Copilot Extension:

    • Open VS Code and go to the Extensions view (Ctrl+Shift+X).
    • Search for "GitHub Copilot" and click "Install."
  2. Sign In to GitHub:

    • Once installed, sign in to your GitHub account when prompted.
  3. Create a New File:

    • Open a new file and save it with a .js extension (or any language you prefer).

Step 2: Writing Your First Lines of Code

Now that you're set up, let's write some code. Here’s how you can leverage GitHub Copilot effectively.

1. Start with Simple Comments

Begin by typing a comment about what you want to achieve. For example:

// This function adds two numbers

After typing the comment, Copilot will suggest a code snippet below. Accept the suggestion by pressing the "Tab" key.

2. Write Basic Functions

Next, you can write more functions. Type another comment like:

// This function multiplies two numbers

Again, accept Copilot's suggestion to quickly generate the function body.

3. Create a Simple Program

Now, let’s put together a simple program that uses the functions you’ve created. Start by writing:

// Main program

Copilot will likely suggest a basic structure for invoking your functions. Accept the suggestions, and you’ll have a functional program in no time.

Step 3: Testing Your Code

Once you have your code, it’s time to test it. Here’s how:

  1. Run Your Code: You can use the terminal in VS Code to run your JavaScript file.
  2. Check Outputs: Make sure the outputs are as expected. You can modify inputs if necessary.

Troubleshooting: What Could Go Wrong

  • No Suggestions: If Copilot doesn’t suggest anything, try rephrasing your comments or be more explicit.
  • Errors in Code: If the code doesn’t run as expected, check for syntax errors. Remember, Copilot is a tool and might not be perfect.

What’s Next: Building on Your Skills

Now that you've written your first 50 lines of code, what should you do next? Here are some recommendations:

  1. Experiment More: Change the functions or add new ones to see how they work.
  2. Learn the Basics: Spend some time diving deeper into JavaScript through online courses or tutorials.
  3. Join the Community: Engage with other learners on platforms like Stack Overflow or Reddit.

Conclusion: Start Here!

To wrap it up, using GitHub Copilot can significantly reduce the friction of starting to code. In just one hour, you can write your first 50 lines of code and begin your coding journey. Just remember to keep experimenting and learning.

What We Actually Use

For beginners, GitHub Copilot remains our go-to tool for coding assistance. It’s cost-effective and provides real-time suggestions that can help speed up your learning process.

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read