Ai Coding Tools

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

By BTW Team4 min read

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

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.

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

AI Coding Tools: 7 Common Mistakes New Developers Make

AI Coding Tools: 7 Common Mistakes New Developers Make As someone who has spent years building products and experimenting with AI coding tools, I can tell you that diving into the

Jun 9, 20264 min read
Ai Coding Tools

10 AI Coding Tools You Need to Build Faster in 2026

10 AI Coding Tools You Need to Build Faster in 2026 As a solo founder or indie hacker, you know that time is your most precious resource. In 2026, the landscape of software develop

Jun 9, 20265 min read
Ai Coding Tools

How to Use Cursor AI to Write 100 Lines of Code in 30 Minutes

How to Use Cursor AI to Write 100 Lines of Code in 30 Minutes As indie hackers and solo founders, we often find ourselves juggling multiple tasks. Writing code can be one of the mo

Jun 9, 20264 min read
Ai Coding Tools

Comparing GitHub Copilot vs Cursor: Which AI Tool is Worth Your Money?

Comparing GitHub Copilot vs Cursor: Which AI Tool is Worth Your Money? As a solo founder or indie hacker, finding the right tools to streamline your coding process is crucial. With

Jun 9, 20263 min read
Ai Coding Tools

How to Reduce Your Debugging Time by 50% Using AI Tools

How to Reduce Your Debugging Time by 50% Using AI Tools As indie hackers and solo founders, we often find ourselves spending countless hours tracking down bugs and fixing code. It’

Jun 9, 20263 min read
Ai Coding Tools

10 Best AI Coding Tools for Beginners to Get Started in 2026

10 Best AI Coding Tools for Beginners to Get Started in 2026 If you're new to coding in 2026, you're in luck. The landscape of AI coding tools has exploded, making it easier than e

Jun 9, 20265 min read