Ai Coding Tools

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

By BTW Team4 min read

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

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!

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 How to Boost Your Coding Speed with AI Tools in 2026

5 How to Boost Your Coding Speed with AI Tools in 2026 As a solo founder or indie hacker, you’re probably familiar with the pain of coding bottlenecks that slow down your project.

Jul 16, 20265 min read
Ai Coding Tools

Cursor vs GitHub Copilot: Which AI Coding Tool Provides Better Code Support?

Cursor vs GitHub Copilot: Which AI Coding Tool Provides Better Code Support? (2026) As a solo founder or indie hacker, you're probably juggling multiple projects and trying to maxi

Jul 16, 20263 min read
Ai Coding Tools

Best AI Coding Tools for Indie Developers in 2026

Best AI Coding Tools for Indie Developers in 2026 As an indie developer, finding the right tools to boost productivity while keeping costs low is a constant challenge. In 2026, AI

Jul 16, 20264 min read
Ai Coding Tools

5 Mistakes You'll Make When Relying on AI Coding Tools

5 Mistakes You'll Make When Relying on AI Coding Tools In 2026, AI coding tools are becoming increasingly popular among indie hackers and solo founders. While they promise to make

Jul 16, 20263 min read
Ai Coding Tools

How to Build Your First API Using AI Tools in Under 2 Hours

How to Build Your First API Using AI Tools in Under 2 Hours Building an API can seem daunting, especially if you're a solo founder or indie hacker without a deep technical backgrou

Jul 16, 20264 min read
Ai Coding Tools

Five Myths About AI Coding Tools That Every Developer Should Know

Five Myths About AI Coding Tools That Every Developer Should Know As we dive into 2026, AI coding tools have become more prevalent than ever. But despite their increasing importanc

Jul 16, 20264 min read