Ai Coding Tools

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

By BTW Team3 min read

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

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!

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

How to Master GitHub Copilot in 3 Simple Steps

How to Master GitHub Copilot in 3 Simple Steps In 2026, coding tools are evolving rapidly, and GitHub Copilot is at the forefront of this change. If you’re like many indie hackers

Aug 8, 20263 min read
Ai Coding Tools

The Great Debate: Cursor vs. Codeium - Which AI Tool is Worth Your Time?

The Great Debate: Cursor vs. Codeium Which AI Tool is Worth Your Time? In the rapidly evolving landscape of AI coding tools in 2026, two names have emerged as frontrunners: Cursor

Aug 8, 20263 min read
Ai Coding Tools

How to Use Cursor to Automate Your Development Tasks in 1 Hour

How to Use Cursor to Automate Your Development Tasks in 1 Hour As indie hackers and solo founders, we often find ourselves drowning in repetitive tasks that eat up our precious dev

Aug 8, 20263 min read
Ai Coding Tools

How to Maximize Productivity with GitHub Copilot in Under 60 Minutes

How to Maximize Productivity with GitHub Copilot in Under 60 Minutes If you're like me, you've probably spent countless hours wrestling with code, trying to remember syntax, or fig

Aug 8, 20264 min read
Ai Coding Tools

Cursor vs Codeium for AI-Assisted Coding: Which is Better for Expert Developers in 2026?

Cursor vs Codeium for AIAssisted Coding: Which is Better for Expert Developers in 2026? As an expert developer, you know that the right tools can make or break your productivity. I

Aug 7, 20264 min read
Ai Coding Tools

How to Use GitHub Copilot Effectively to Improve Your Coding in 30 Minutes

How to Use GitHub Copilot Effectively to Improve Your Coding in 30 Minutes Have you ever found yourself staring at a blank screen, unsure of how to start coding a new feature? You’

Aug 7, 20263 min read