← All guides

Vibe coding: what it is, examples and why you must understand the code AI writes

Vibe coding means building software by describing what you want to an AI, in plain language, and accepting the code it produces without reading it line by line. Andrej Karpathy (an OpenAI co-founder and former head of AI at Tesla) made the term famous in February 2025, and in 2025 Collins Dictionary picked it as its word of the year.

How it works in practice

You open a tool like ChatGPT, Claude, Cursor or Claude Code and type what you want: "build me a page that computes mortgage payments", "add Google login", "fix this error". The AI writes the code, you run it, look at the result and ask for changes until it "works".

It is very powerful for prototypes, personal projects and throwaway tools. The problem comes when that code has to really work: with real data, real users, real money.

The limit: "looks like it works" is not "works"

AI writes plausible, tidy, confident code, even when it is wrong. Try it yourself: this AI-generated function checks whether a customer paid the right amount.

def payment_ok(prices, paid):
    total = sum(prices)
    return total == paid

print(payment_ok([0.10, 0.20], 0.30))

The customer paid exactly 0.30, but the program prints False. The reason: for the computer 0.10 + 0.20 is not exactly 0.30 (it is 0.30000000000000004). With money you work in whole cents:

def payment_ok(prices, paid):
    total = sum(round(p * 100) for p in prices)
    return total == round(paid * 100)

print(payment_ok([0.10, 0.20], 0.30))

If you vibe code without being able to read code, you will not see this bug until a customer complains.

Pros and cons of vibe coding

Pros

Cons

How to vibe code without getting burned

  1. Predict before running: with simple data, what should come out? If the output differs, there is a bug.
  2. Try edge cases: empty list, zero, negative numbers, decimals, empty text.
  3. Ask the AI to explain the code line by line, and check that the explanation adds up.
  4. Have it write tests and read them: they must check the behaviour you really need.
  5. Never put secrets in code: passwords and keys belong in environment variables.
  6. Learn the basics: a few weeks are enough to recognise the AI's most common mistakes.

FAQ

Is vibe coding for beginners? Anyone can do it, but it only pays off if you can check what the AI produces.

Do I need to know how to code? Not for prototypes; for anything that must work with real users, yes: at least enough to read the code.

Which tools are used? The most common are ChatGPT, Claude and Claude Code, Cursor and GitHub Copilot.

Want to practise spotting AI mistakes? In the Coding with AI path every challenge is generated code with a real bug to fix, right in your browser.

Sources

Learn by doing, not just reading

Zero-to-advanced paths with exercises you write and run in the browser. The first chapters are free.