Code — AI Basics
AI BasicsWhat can you use it for?

Code

A chatbot can write code, even for people who can't program. Like a fast handyman who builds you a shelf. Before you put your books on it, you test that it holds. Learn how to make something small with AI, and when to ask an expert.

Time 20 minutesChecked on 28-10-2026Read first Search and research
1/12

First, what do you think?

A chatbot writes a small program for you, and it runs. Is it safe to use? Have a guess.

2/12

What can AI do with code?

The whole story in three sentences. Code is text, so a chatbot can predict it. From your description, it writes a small program, a formula or a web page. That helps beginners and experts, but you still test what it builds.

Think of a fast handyman. You describe the shelf you want. Ten minutes later, it's on the wall. Great. But before you put your books on it, you push on it. Does it hold?

  • Write. A small game, a web page, a formula that adds up your expenses.
  • Explain. "What does this line do?" A chatbot can explain code step by step.
  • Fix. Paste an error message, and ask what went wrong.

How much does it help? Research gives a mixed picture.

  • Faster on a fresh task. In one study, developers had to build a small web server. The group with an AI assistant finished 55.8% faster.
  • Slower on familiar work. In another study, experienced developers worked on their own large projects. With AI they took 19% longer. They thought it had made them faster.
  • Less secure. In a third study, people with an AI assistant wrote less secure code. And they were more likely to believe it was secure.
3/12

What the predictor does

The predictor writes code that fits your description. That's the rule.

Code that fits isn't always code that's right. It may work for your first test, and fail for the next. It may work, but leave a door open for hackers. The predictor doesn't test its own work unless a tool makes it.

And there's a trap. Code that runs feels finished. That's why people in the third study felt safe while their code wasn't. The ones who trusted the AI less did better.

Remember

The handyman builds fast. You push on the shelf before you trust it. For anything with passwords, money or personal data, you ask an expert to push too.

4/12

Try it yourself

Three moments when a chatbot wrote code for you. What's your next step?

Everything runs in your browser. Nothing you type is sent anywhere.

5/12

How do you build something with AI?

Four steps. Try them today on something tiny, like a page with a joke of the day.

Describe it in plain words

Say what it should do, for whom, and where it runs. Start small: one piece at a time.

Run it and test it

Try normal input, and odd input. An empty box, a very long name, a zero. Does it still work?

Ask it to explain

Ask: "Explain what each part does." Read along. You'll learn, and you'll spot parts that seem wrong.

Get a check for anything risky

Passwords, payments, personal data: let someone who knows security look at it. Never paste real passwords or keys into a chatbot.

6/12

In practice

Three people get help from the handyman.

Case 1The quiz game

Situation

Ruben (15) wants a quiz game about football for his friends. He's never programmed. A chatbot writes it in a few minutes, and it works.

What most people do

Share it, and move on.

Why that doesn't work

It's fine to share. But Ruben learns nothing about how it works. And for a school assignment, AI may help, but not replace his own work.

What works better

Ask the chatbot to explain each part. Change something small himself, like the colours or the questions.

Why that helps

The game works, and Ruben understands a bit of code.

Case 2The spreadsheet formula

Situation

Linda (38) needs a formula that adds up hours per project. A chatbot gives one. It looks right.

What most people do

Use it for the whole team.

Why that doesn't work

It may work for the first rows and go wrong for others. Code that fits isn't always code that's right.

What works better

Test it on a few rows she can check by hand. Including an empty cell and a weird date.

Why that helps

She finds the problem before the team relies on it.

Case 3The web shop

Situation

Erik (45) sells handmade candles. He asks a chatbot to build a shop page with payments. It runs on his laptop.

What most people do

Put it online.

Why that doesn't work

People with AI help write less secure code, and still feel safe. A payment page needs to be secure.

What works better

Use an existing shop service for payments. Or let an expert check the code before it goes online.

Why that helps

His customers' money and data stay safe.

7/12

When not to

  • Not for passwords, payments or personal data, uncheckedIt can leave doors open.Use a trusted service, or ask an expert.
  • Not instead of learningAt school, AI helps but doesn't replace your work.Ask it to explain, and write parts yourself.
  • Not when you can't test itYou can't see if it's right.Start smaller, or ask someone to test it with you.
8/12

By situation

Use AI to explain code and errors. Write the parts that are graded yourself, and say when you used AI. Ask your teacher what's allowed.

9/12

Myths and mistakes

ClaimTrue?Why
AI always makes programming fasterNoOne study: 55.8% faster. Another: experienced developers 19% slower.
If it runs, it's safeNoPeople with AI help wrote less secure code, and felt safer.
You need to know programming to startNoYou can start, but you do need to test.
You'll notice if it slows you downNot alwaysDevelopers who were slower thought they'd been faster.
10/12

Related topics

Read first

Next

  • AI agentsAI that doesn't only write, but also does things.

Related

11/12

Sources

All sources of this course →

12/12

Test

You get 7 questions about the whole page. Get 5 right, and you've mastered the topic.

About the tools in this course. Every tool is described in the same way, in alphabetical order, without a recommendation. Names, prices and features change often: the maker's own site is always right. This site was built with the help of Claude, one of the tools described here.