Ai Coding Tools

How to Use GitHub Copilot to Write Your First 10 Functions

By BTW Team3 min read

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

In short

A step-by-step guide on utilizing GitHub Copilot effectively to assist in writing your first ten functional algorithms, perfect for novice programmers in just a few hours.

As a solo founder or indie hacker, you often wear many hats. Writing code can feel overwhelming, especially when you're just trying to get your project off the ground. That's where GitHub Copilot comes in. It's like having a coding buddy that suggests entire functions based on the context you're working in. But how do you leverage it effectively? Let's break it down step-by-step.

Time Estimate: 1-2 hours to get comfortable with GitHub Copilot

Prerequisites:

  • A GitHub account
  • Visual Studio Code (VS Code) installed
  • GitHub Copilot subscription ($10/month after a 14-day free trial)

Getting Started with GitHub Copilot

Step 1: Set Up Your Environment

  1. Install VS Code: If you haven't already, download and install Visual Studio Code from here.
  2. Install GitHub Copilot: Open VS Code, go to the Extensions view (Ctrl+Shift+X), and search for "GitHub Copilot". Click "Install".
  3. Sign In: After installation, sign in using your GitHub account.

Step 2: Write Your First Function

  1. Create a New File: Start a new JavaScript file (or any language of your choice).
  2. Comment Your Intent: Type a comment describing what you want the function to do. For example:
    // Function to add two numbers
    
  3. Let Copilot Suggest: After typing the comment, hit Enter and see what Copilot suggests. It usually generates the function you need.

Step 3: Iterate and Improve

  1. Review the Code: Check the suggested code for accuracy and efficiency.
  2. Modify as Needed: You can tweak the function to better fit your requirements. For example, if you need to handle edge cases, add conditions.

Repeat for 10 Functions

Continue this process for your first ten functions. Here are some ideas to get you started:

  1. Add two numbers
  2. Subtract two numbers
  3. Multiply two numbers
  4. Divide two numbers
  5. Find the maximum of an array
  6. Calculate the factorial of a number
  7. Check if a string is a palindrome
  8. Sort an array
  9. Fetch data from an API
  10. Validate an email address

What Could Go Wrong

  • Over-reliance: Don’t blindly trust Copilot; always review the code it generates. It can make mistakes or suggest insecure coding practices.
  • Learning Curve: It might take a while to get used to how Copilot works. Be patient and practice.

What's Next

Once you've written your functions, consider integrating them into a larger project. This will help solidify your understanding and improve your coding skills. You might also want to explore other AI coding tools that complement GitHub Copilot.

Conclusion

GitHub Copilot can significantly speed up your coding process, especially when you're just starting. By following the steps above, you'll be able to write your first ten functions in no time. Start with simple tasks and gradually tackle more complex ones. If you're looking for a way to enhance your coding efficiency, give GitHub Copilot a shot.

What We Actually Use

We primarily use GitHub Copilot for quick function generation during our development sprints. It helps us prototype features faster, but we always double-check the output to ensure quality.

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