Ai Coding Tools

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

By BTW Team4 min read

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

In short

A practical step-by-step guide to leveraging GitHub Copilot to help you write five basic code functions quickly, ideal for those new to coding.

If you’re an indie hacker or a solo founder looking to get your hands dirty with coding, you might feel overwhelmed by the prospect of writing your first functions. The good news? GitHub Copilot can make this process significantly easier. I’ve found that with just an hour of focused effort, you can leverage Copilot to help you write your first five code functions. Let’s dive into how to do this effectively in 2026.

Prerequisites

Before we jump in, make sure you have the following:

  1. GitHub Account: You need an account to access GitHub Copilot.
  2. Visual Studio Code (VS Code): Download and install VS Code if you haven’t already.
  3. GitHub Copilot Subscription: As of June 2026, Copilot costs $10/month after a 60-day free trial. It's worth it if you plan to code regularly.
  4. Basic Understanding of Programming: Familiarity with at least one programming language (like JavaScript or Python) will help, but Copilot can guide you through.

Step-by-Step Guide to Writing Your First 5 Functions

Step 1: Set Up Your Environment (15 minutes)

  1. Install VS Code: Download from here.
  2. Install GitHub Copilot: In VS Code, go to Extensions (Ctrl+Shift+X) and search for “GitHub Copilot.” Click install.
  3. Create a New File: Start a new file with a .js or .py extension, depending on your language of choice.

Step 2: Write Your First Function (10 minutes)

Let’s start with a simple function that adds two numbers. Type the following comment in your file:

// Function to add two numbers

Hit Enter, and Copilot should suggest a function. Accept the suggestion (usually by pressing Tab).

Step 3: Continue with More Functions (25 minutes)

Repeat the process for the next four functions. Here are some ideas:

  1. Subtract two numbers:

    // Function to subtract two numbers
    
  2. Multiply two numbers:

    // Function to multiply two numbers
    
  3. Divide two numbers:

    // Function to divide two numbers
    
  4. Find the maximum of two numbers:

    // Function to find the maximum of two numbers
    

Copilot will offer suggestions for each function. Feel free to tweak the suggestions to suit your needs.

Step 4: Test Your Functions (5 minutes)

Once you’ve got your functions written, it’s time to test them. Create a new section in your file to call these functions:

console.log(add(5, 3)); // Should print 8
console.log(subtract(5, 3)); // Should print 2
console.log(multiply(5, 3)); // Should print 15
console.log(divide(6, 3)); // Should print 2
console.log(max(5, 3)); // Should print 5

Run your code in the terminal to see if everything works as expected.

Troubleshooting: What Could Go Wrong

  • Copilot Suggestions Are Off: Sometimes, Copilot might not understand your comment. Try rephrasing or providing more context.
  • Errors in Code: If you run into errors, check for typos or syntax issues. Copilot won’t always get it right.
  • Functionality Limitations: While Copilot is powerful, it may not handle edge cases well. Always review the code it generates.

What's Next?

Now that you've written your first five functions, consider expanding your coding skills. Here are some options:

  1. Learn a New Language: Explore other programming languages that interest you.
  2. Build a Small Project: Use your functions in a mini-project to solidify your understanding.
  3. Explore Advanced Features of Copilot: Look into how Copilot can help with more complex coding tasks.

Conclusion

Using GitHub Copilot to write your first five code functions in just an hour is not only possible but also a practical way to dip your toes into coding. Start by setting up your environment, then let Copilot guide you through the process. Remember, it’s okay to make mistakes and learn from them.

If you're serious about coding, consider subscribing to GitHub Copilot and making it a part of your toolkit. It can streamline your development process and make coding less intimidating.

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