Ai Coding Tools

How to Use GitHub Copilot for Writing Efficient Code in 2 Hours

By BTW Team4 min read

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

In short

A step-by-step tutorial on maximizing productivity with GitHub Copilot, enabling developers to write efficient code in just 2 hours.

If you're like many indie hackers or side project builders, you know that writing code can often feel like a slog. You want to focus on building features, not wrestling with syntax or remembering the exact function names. Enter GitHub Copilot, an AI-powered coding assistant that claims to help you write code more efficiently. But does it really deliver? In this guide, I’ll walk you through how to set up and use GitHub Copilot effectively within 2 hours, and share some honest trade-offs to consider.

Time Estimate: 2 Hours

You can finish this setup in about 2 hours if you follow along step-by-step.

Prerequisites

Before diving in, make sure you have the following:

  1. A GitHub account (free)
  2. Visual Studio Code (VS Code) installed (free)
  3. GitHub Copilot subscription ($10/month or $100/year)
  4. Basic familiarity with JavaScript or Python (for best results)

Step-by-Step Setup

1. Install Visual Studio Code

Download and install Visual Studio Code from here. It’s a lightweight yet powerful code editor that works well with GitHub Copilot.

2. Install GitHub Copilot Extension

  • Open VS Code.
  • Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window.
  • Search for "GitHub Copilot" and click "Install."

3. Sign In to GitHub

Once the extension is installed:

  • Open the Command Palette (Ctrl+Shift+P).
  • Type “GitHub: Sign in” and follow the prompts to link your GitHub account.

4. Start a New Project

Create a new folder for your project and open it in VS Code.

5. Write Some Code

Begin writing a function or piece of code. For example, if you're in JavaScript, start with:

function calculateSum(a, b) {

You’ll notice that Copilot starts suggesting completions almost immediately. Accept its suggestion by hitting the Tab key.

6. Experiment with Different Prompts

To get the best out of Copilot, try writing comments or prompts for what you want to achieve. For instance:

// Create a function that fetches data from an API

Copilot should generate a function that outlines the structure of your API call.

7. Review and Edit Suggestions

Copilot’s suggestions won’t always be perfect. Make sure to review each suggestion carefully. For example, if it suggests a method that doesn't handle errors, you may want to add error handling logic yourself.

Troubleshooting Common Issues

  • Suggestion Lag: If suggestions are slow, check your internet connection. Copilot relies on cloud processing.
  • Inaccurate Suggestions: Sometimes, Copilot generates code that doesn’t fit your context. Always validate the output.

What's Next?

Once you feel comfortable using Copilot, consider exploring its advanced features:

  • Pair Programming: Use Copilot to assist in pair programming sessions, where it can suggest alternative solutions.
  • Learning New Languages: Try out Copilot for languages you’re not familiar with, like Go or Ruby. It can help you learn syntax and best practices.

Limitations

While GitHub Copilot can speed up coding significantly, it has its drawbacks:

  • Not Always Accurate: The suggestions can be off-target, especially for complex logic.
  • Dependency on Prompts: If your prompts are vague, the output can also be vague.
  • Subscription Cost: At $10/month, it might not be feasible for everyone, particularly if you're just starting out.

Pricing Comparison of AI Coding Tools

| Tool | Pricing | Best For | Limitations | Our Verdict | |--------------------|----------------------------|---------------------------------|-----------------------------------|----------------------------------| | GitHub Copilot | $10/mo or $100/yr | General coding assistance | Can be inaccurate, needs prompts | Essential for rapid coding | | TabNine | Free tier + $12/mo pro | Autocompletion for many languages| Limited to code completion only | Good for specific languages | | Codeium | Free | AI-assisted code suggestions | Fewer integrations | Great for budget-conscious users | | Replit | Free tier + $20/mo pro | Collaborative coding | Less focused on individual coding | Best for team projects | | Sourcery | Free tier + $12/mo pro | Python code improvement | Limited to Python | Great for Python developers | | AI Dungeon | Free tier + $10/mo pro | Story-driven coding examples | Not focused on traditional coding | Fun for creative coding |

What We Actually Use

In our experience, we primarily use GitHub Copilot for its versatility and integration with VS Code, especially when building new features rapidly. For more complex projects, we also incorporate TabNine for additional language support, but GitHub Copilot remains our go-to tool.

Conclusion

To get started with GitHub Copilot, follow the steps outlined above, and remember to keep an eye on the quality of the code it suggests. It’s a powerful tool that, when used correctly, can significantly enhance your coding efficiency.

If you're looking to take your coding to the next level, give GitHub Copilot a try today.

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