Ai Coding Tools

How to Use GitHub Copilot to Write Your First 10 Lines of Code in Under 30 Minutes

By BTW Team4 min read

How to Use GitHub Copilot to Write Your First 10 Lines of Code in Under 30 Minutes

If you're a beginner trying to learn how to code, the prospect of writing your first lines of code can feel daunting. You might be wondering, "Where do I even start?" Well, in 2026, tools like GitHub Copilot have made it easier than ever. With the right approach, you can write your first 10 lines of code in under 30 minutes. Let’s dive into how you can leverage GitHub Copilot effectively.

What is GitHub Copilot?

GitHub Copilot is an AI-powered coding assistant that helps you write code faster and with fewer errors. It suggests whole lines or blocks of code based on the context of what you're writing. Think of it as your coding partner who’s always ready to jump in with a suggestion.

Pricing Breakdown

  • Free Trial: 14 days
  • Individual Plan: $10/month
  • Business Plan: $19/user/month

Best for: Individuals and teams who want to streamline their coding process. Limitations: It may not always produce the best code or understand complex contexts.

Prerequisites

Before we get started, make sure you have the following:

  1. GitHub Account: Create a free account at GitHub.
  2. Code Editor: Install Visual Studio Code (VS Code) – it's free and widely used.
  3. GitHub Copilot Extension: Install the GitHub Copilot extension in VS Code.

Step-by-Step Guide to Writing Your First 10 Lines of Code

1. Set Up Your Environment (5 minutes)

  • Install Visual Studio Code: Download and install it from here.
  • Install GitHub Copilot: Open the Extensions view in VS Code and search for "GitHub Copilot." Click "Install."

2. Create a New File (2 minutes)

  • Open VS Code.
  • Click on "File" > "New File" and save it as hello.js (or any other language you’re interested in).

3. Start Coding (15 minutes)

Now, let’s write some simple code. Start typing a comment about what you want to do. For example:

// This is a simple program to greet the user

As you type, Copilot will suggest code. Accept its suggestion by pressing Tab. You can also ask it to generate a function:

// Function to greet the user
function greet(name) {

Once you type the opening brace {, Copilot will suggest the rest of the function. Accept it and your code might look like this:

function greet(name) {
    console.log("Hello, " + name + "!");
}

4. Complete Your Code (5 minutes)

Add the following lines to call the function:

greet("World");

Your final code should look like this:

// This is a simple program to greet the user
function greet(name) {
    console.log("Hello, " + name + "!");
}
greet("World");

5. Run Your Code (3 minutes)

  • Open the terminal in VS Code (Ctrl + backtick).
  • Run the command: node hello.js (make sure you have Node.js installed).

You should see the output: Hello, World!.

Troubleshooting Common Issues

  • Copilot isn’t suggesting code: Make sure you’re typing relevant comments or code snippets. Copilot works best when it has context.
  • Error running the code: Double-check for syntax errors or ensure you have the right runtime environment set up.

What's Next?

Now that you’ve written your first lines of code, consider exploring more complex functions or even different programming languages. Use GitHub Copilot to assist you along the way.

Tools and Resources to Explore

While GitHub Copilot is a fantastic tool, here are some alternatives and complementary tools you might consider:

| Tool Name | Pricing | Best For | Limitations | Our Take | |-------------------|------------------------|-----------------------------------------|-----------------------------------------------|-----------------------------------| | TabNine | Free + Pro at $12/mo | Autocompletion for multiple languages | Less effective in context than Copilot | We use this for quick suggestions. | | Replit | Free + Pro at $7/mo | Collaborative coding | Limited features in the free version | Great for collaborative projects. | | Codeium | Free | AI code completion | Still in beta, can be buggy | We don’t use it yet, but watching. | | Sourcery | Free + Pro at $12/mo | Python code improvement | Focused only on Python | Useful for Python developers. | | Kite | Free + Pro at $16.60/mo | Python and JavaScript autocompletion | Limited to specific languages | We use this for Python projects. |

Conclusion

In just under 30 minutes, you can write your first 10 lines of code using GitHub Copilot. This tool not only helps you reduce the friction of starting but also provides valuable suggestions that improve your coding skills over time.

Start Here: If you're new to coding, set up GitHub Copilot in VS Code and follow the steps above. You'll be amazed at how quickly you can produce working code.

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