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

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
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for Beginners

10 Common Mistakes When Using AI Coding Tools for Beginners As a beginner in coding, diving into AI coding tools can feel like a doubleedged sword. On one hand, these tools promise

Oct 8, 20264 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back As a solo founder or indie hacker, you might be considering leveraging AI coding tools to boost your produc

Oct 7, 20264 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools That Will Hurt Your Learning

5 Common Misconceptions About AI Coding Tools That Will Hurt Your Learning As a beginner in coding, diving into the world of AI coding tools can feel like stepping into a futuristi

Oct 6, 20263 min read
Ai Coding Tools

10 AI Coding Tools Beginners Overlook in 2026

10 AI Coding Tools Beginners Overlook in 2026 As a beginner in coding, diving into the vast ocean of AI tools can feel overwhelming. While flashy tools often grab the spotlight, ma

Oct 6, 20265 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools That Beginners Believe

5 Common Misconceptions About AI Coding Tools That Beginners Believe As a solo founder or indie hacker, diving into the world of AI coding tools can feel overwhelming, especially i

Oct 5, 20263 min read