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

5 Mistakes Every Beginner Makes When Using AI Coding Tools

5 Mistakes Every Beginner Makes When Using AI Coding Tools As a solo founder or indie hacker diving into the world of AI coding tools, it’s easy to get swept up in the excitement o

Oct 4, 20264 min read
Ai Coding Tools

10 Common Misconceptions About AI Coding Tools in 2026

10 Common Misconceptions About AI Coding Tools in 2026 As we dive into 2026, AI coding tools have become a staple in the developer toolkit. However, misconceptions still run rampan

Oct 4, 20264 min read
Ai Coding Tools

5 Mistakes to Avoid When Using AI Coding Tools for Real Projects

5 Mistakes to Avoid When Using AI Coding Tools for Real Projects As we dive deeper into 2026, AI coding tools have become an essential part of the developer's toolkit. However, usi

Oct 4, 20264 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools and Why They Matter

5 Common Misconceptions About AI Coding Tools and Why They Matter As a solo founder or indie hacker, you’re likely eyeing AI coding tools to boost your productivity and streamline

Oct 4, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make with AI Coding Tools in 2026

5 Common Mistakes Developers Make with AI Coding Tools in 2026 As we dive deeper into 2026, AI coding tools have become essential for developers looking to enhance productivity and

Oct 4, 20263 min read
Ai Coding Tools

How to Automate Your Development Workflow with AI in 3 Easy Steps

How to Automate Your Development Workflow with AI in 3 Easy Steps (2026) As indie hackers and solo founders, we often find ourselves buried under a mountain of repetitive tasks tha

Sep 3, 20264 min read