Ai Coding Tools

How to Write Your First Functions Using AI Coding Assistants in Under 30 Minutes

By BTW Team3 min read

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

In short

A step-by-step guide for beginners to quickly learn how to write their first functions using AI coding assistants like GitHub Copilot.

If you're just starting out with coding, the thought of writing your first functions can feel daunting. But with the rise of AI coding assistants, you can get up and running in no time. In fact, I believe you can write your first functions in under 30 minutes using tools like GitHub Copilot or other AI coding tools. Let's dive into how to do this effectively in 2026.

Prerequisites: What You Need to Get Started

Before we jump into the step-by-step process, let's cover what you'll need:

  1. A Code Editor: Visual Studio Code (VS Code) is a solid choice and it's free.
  2. An AI Coding Assistant: GitHub Copilot is a popular choice, but there are others like Tabnine and Codeium.
  3. Basic Programming Knowledge: Familiarity with programming concepts like variables and loops will help, but you can still follow along if you're a complete beginner.

Step 1: Setting Up Your Environment (5 Minutes)

  • Install Visual Studio Code: Download it from the official site.
  • Install GitHub Copilot: You can get started with a free trial. After that, it’s $10/month for individuals. Follow the instructions on GitHub's site for installation.
  • Create a New File: Open VS Code and create a new file with a .js or .py extension depending on your preferred language.

Step 2: Writing Your First Function (15 Minutes)

Let’s say you want to write a simple function that adds two numbers together.

  1. Start by Typing the Function Name: Write function addNumbers(a, b) in JavaScript or def add_numbers(a, b): in Python.

  2. Invoke GitHub Copilot: As you start typing, GitHub Copilot will suggest code. Accept the suggestion by hitting Tab.

  3. Complete the Function: Your code should look something like this:

    JavaScript Example:

    function addNumbers(a, b) {
        return a + b;
    }
    

    Python Example:

    def add_numbers(a, b):
        return a + b
    
  4. Test Your Function: Right below your function, call it with sample inputs:

    console.log(addNumbers(5, 10)); // Output: 15
    
    print(add_numbers(5, 10)) # Output: 15
    

Step 3: Troubleshooting Common Issues (5 Minutes)

While using AI coding assistants can be a breeze, you might encounter a few hiccups:

  • No Suggestions: Make sure Copilot is activated. Check your extensions in VS Code.
  • Incorrect Code: AI suggestions aren't always perfect. Review the code it generates and tweak it as needed.

Step 4: What's Next? (5 Minutes)

Now that you’ve written your first function, consider these next steps:

  1. Explore More Functions: Try creating functions that handle different tasks, like subtracting or multiplying numbers.
  2. Learn About Parameters: Experiment with default parameters and return types.
  3. Check Out More AI Tools: Other great AI coding assistants include Tabnine and Codeium.

Tool Comparison Table

| Tool | Pricing | Best For | Limitations | Our Take | |-----------------|-----------------------|----------------------------|---------------------------------|-----------------------------| | GitHub Copilot | $10/mo (free trial) | General coding assistance | Limited to certain languages | We use this for JavaScript | | Tabnine | Free tier + $12/mo | Quick code suggestions | Less context-aware than Copilot | We don’t use this as much | | Codeium | Free | Multi-language support | Fewer integrations | Worth trying for beginners |

Conclusion: Start Here

To write your first functions using AI coding assistants, start with GitHub Copilot in Visual Studio Code. Follow the steps outlined above, and don't hesitate to explore more about programming as you build your skills. Remember, practice is key!

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