Ai Coding Tools

How to Use GitHub Copilot to Write Your First 10 Functions in 1 Hour

By BTW Team4 min read

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

In short

A step-by-step guide to harnessing GitHub Copilot's AI capabilities to quickly create your initial functions, perfect for beginners.

If you’ve ever found yourself staring at a blank screen, trying to figure out how to code a simple function, you're not alone. Many indie hackers and solo founders hit this wall, especially when time is tight and there are a million other tasks to juggle. Enter GitHub Copilot: an AI-powered tool that can help you write code faster. But can it really help you write your first 10 functions in just one hour? Spoiler alert: Yes, it can—but with some caveats.

In this guide, I'll walk you through how to leverage GitHub Copilot effectively, including what you need to get started, a step-by-step process, and some honest limitations of the tool.

Prerequisites: What You Need to Get Started

Before diving in, make sure you have the following set up:

  1. GitHub Account: You’ll need this to access Copilot.
  2. Visual Studio Code: This is the IDE where you'll use Copilot. You can download it for free.
  3. GitHub Copilot Subscription: As of June 2026, pricing starts at $10/month after a free trial period.
  4. Basic Understanding of JavaScript or Python: This guide uses JavaScript for examples, but the principles apply to other languages as well.

Step-by-Step: Writing Your First 10 Functions

Step 1: Setting Up GitHub Copilot in Visual Studio Code

  1. Install the GitHub Copilot Extension:
    • Open Visual Studio Code.
    • Go to the Extensions view (Ctrl+Shift+X).
    • Search for "GitHub Copilot" and install it.
  2. Sign In to Your GitHub Account:
    • After installation, a prompt will ask you to sign in. Follow the instructions.

Step 2: Write Your First Function

  1. Create a New File:
    • Open a new JavaScript file (functions.js).
  2. Start Typing a Function:
    • Type function add(a, b) and hit Enter. Copilot will suggest a complete function.
  3. Review and Accept Suggestions:
    • If the suggestion looks good, hit Tab to accept it. If not, you can modify it.

Step 3: Repeat for Additional Functions

  1. Function 2: Subtract:
    • Type function subtract(a, b) and accept the suggestion.
  2. Function 3: Multiply:
    • Type function multiply(a, b) and accept the suggestion.
  3. Continue this Process:
    • Repeat for functions like divide, square, cube, isEven, isOdd, factorial, and fibonacci.

By the time you finish, you should have 10 basic functions in about 30-45 minutes.

Step 4: Testing Your Functions

  1. Write Test Cases:
    • After you’ve written your functions, create a new file (test.js) and write simple test cases for each function.
  2. Run Your Tests:
    • Use Node.js to run your tests and ensure everything works as expected.

Expected Outputs

Here’s what you might have at the end of your coding session:

function add(a, b) { return a + b; }
function subtract(a, b) { return a - b; }
function multiply(a, b) { return a * b; }
function divide(a, b) { return a / b; }
function square(x) { return x * x; }
function cube(x) { return x * x * x; }
function isEven(num) { return num % 2 === 0; }
function isOdd(num) { return num % 2 !== 0; }
function factorial(n) { return n ? n * factorial(n - 1) : 1; }
function fibonacci(n) { return n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2); }

Troubleshooting: What Could Go Wrong

  • Incomplete Suggestions: Sometimes Copilot may not provide complete or correct functions. Don’t hesitate to tweak the suggestions or write your own code.
  • Language Limitations: Copilot excels in popular languages like JavaScript, Python, and TypeScript. If you’re using something less common, the suggestions may not be as robust.

What's Next: Building on Your Functions

After writing and testing your functions, consider the following next steps:

  • Integrate with a Web App: Use these functions in a simple web application.
  • Explore More Advanced Functions: Start tackling more complex logic or data structures.
  • Collaborate with Others: Share your functions on GitHub and encourage feedback.

Conclusion: Start Here with GitHub Copilot

Using GitHub Copilot can drastically speed up your coding process, especially for simple functions. In just one hour, you can write 10 basic functions that serve as a foundation for your projects. Just remember to review and tweak the AI's suggestions, and you’ll be on your way to shipping code faster than ever.

What are you waiting for? Fire up Visual Studio Code and get coding!

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