Ai Coding Tools

How to Write Your First AI-Powered Code in 2 Hours

By BTW Team4 min read

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

In short

A step-by-step guide on how to leverage AI coding tools to write your first program in just 2 hours, perfect for new developers.

So, you want to dabble in AI-powered coding but don’t know where to start? You’re not alone. Many indie hackers and side project builders feel overwhelmed by the technical jargon and complexity surrounding AI coding tools. The good news is: you can write your first AI-powered code in just 2 hours, even if you’re a complete beginner.

Let’s break this down into actionable steps, tools you can use, and what to expect along the way.

Prerequisites: What You Need to Get Started

Before diving in, make sure you have the following:

  1. A computer: Any modern laptop or desktop will work.
  2. An internet connection: You’ll need this to access online tools and resources.
  3. Basic programming knowledge: Familiarity with programming concepts will help, but don’t worry if you’re just starting out.

Step 1: Choose Your AI Coding Tool

Here are some AI coding tools that can help you write code quickly and efficiently. Each offers unique features tailored to different use cases.

AI Coding Tools Comparison Table

| Tool Name | What It Does | Pricing | Best For | Limitations | Our Take | |-------------------|---------------------------------------------|-----------------------------|--------------------------------|------------------------------------------|-------------------------------| | OpenAI Codex | AI-powered code completion and generation | $0-20/mo per usage | Quick coding assistance | Limited to supported languages | We use this for prototypes | | GitHub Copilot | AI code suggestions directly in IDEs | $10/mo | Developers using GitHub | Can suggest incorrect code | Great for improving productivity | | Tabnine | AI completion for various languages | Free tier + $12/mo pro | Multi-language support | Free tier has limited features | We recommend for teams | | Replit | Online IDE with AI capabilities | Free tier + $7/mo pro | Beginners and collaboration | Limited offline capabilities | Excellent for quick projects | | Codeium | Code generation and suggestions | Free | Fast coding and learning | May lack advanced features | Good for JavaScript projects | | Ponicode | AI-powered unit testing | $29/mo, no free tier | Improving test coverage | Focused solely on testing | We don’t use this much | | Sourcery | Code review and suggestions | Free tier + $12/mo pro | Improving existing code | Limited to Python | We use it for Python projects | | ChatGPT | Conversational AI for coding help | Free tier + $20/mo pro | General coding queries | May not provide specific syntax | Use for brainstorming ideas | | DeepCode | AI code review tool | Free tier + $19/mo pro | Continuous integration | Limited language support | We don’t use it as much | | Kite | AI suggestions for Python | Free tier + $19.90/mo pro | Python developers | Limited to Python | Good for beginners |

What We Actually Use

In our experience, we frequently use OpenAI Codex for prototyping and GitHub Copilot for its seamless integration with our workflow. Both tools have their strengths and weaknesses, but they complement each other well.

Step 2: Set Up Your Environment

  1. Install Your Chosen Tool: Follow the setup instructions provided by the tool. Most have straightforward installation processes.
  2. Open Your IDE: Use a code editor like Visual Studio Code, which integrates well with many AI coding tools.
  3. Create a New Project: Start a new project for the code you want to write. This could be a simple web app, a script, or an API.

Step 3: Write Your First AI-Powered Code

Here’s a simple example of how to write a basic Python function using OpenAI Codex.

  1. Ask Codex for Help: Type a comment describing what you want to do. For example, # Create a function that adds two numbers.
  2. Let Codex Generate Code: Hit enter, and watch Codex generate the function for you.
  3. Review and Test the Code: Make sure to check the generated code for accuracy and run it to see if it works.

Expected Output

You should see a function that looks something like this:

def add_numbers(a, b):
    return a + b

Troubleshooting: What Could Go Wrong

  1. Incorrect Code Suggestions: Sometimes, the AI can suggest syntax errors or inefficient code. Always review the suggestions.
  2. Integration Issues: If the tool doesn’t integrate well with your IDE, check settings or consider reinstalling the plugin.

What’s Next: Progressing Your Skills

Once you’ve written your first line of AI-powered code, consider the following steps to deepen your knowledge:

  • Explore More Complex Projects: Try building a simple web application or API.
  • Learn the Basics of AI: Understanding how AI models work can help you leverage tools more effectively.
  • Join Developer Communities: Engage with forums or Discord channels related to AI coding for support and ideas.

Conclusion: Start Here

If you’re looking to dip your toes into AI-powered coding, start with OpenAI Codex or GitHub Copilot. Both tools provide excellent support for beginners and can help you build your first project in no time.

Remember, the key is to experiment and learn from the code you generate. Happy coding!

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