Why does it exist?

Why learn coding when AI writes code?

An AI wrote two programs for the same job: both ran, and one of them was wrong. By the end, you will be able to spot it, and you will know why that skill matters more now that AI writes code.

Read~5 min
Watch4:51 video
Practiceruns right here
Published8 Oct 2026

Prefer to watch? This post goes with the video (4:51). Open it on YouTube.

A question students keep asking me

Of late, students keep asking me one question: "Sir, AI writes code now. Should I still learn coding?" That's a very nice question, and one small test answers it.

Say you and your friends go out for dinner, and the rule is simple: everyone pays an equal share. An AI gives you two programs for it, and one of them is wrong.

Four friends at dinner, and the bill on the table

Program A

share = bill ÷ friends

Program B

share = 500

Decide firstWhich program is wrong, A or B?
Pick one before you read on. The section "The reveal" answers it.

First, let's be fair to the AI

You ask an AI for a program, and within 10 seconds you have it. It runs, and many times it is even correct.

But an AI writes both right and wrong code, and the wrong code doesn't always look wrong.

The bill: 2,000 rupees
A bill of 2,000 rupees, shared by 4 friends.
Try it: run both programs

The goal: see what each program says for tonight's dinner.

The step: press Run. The bill is 2,000 rupees, and there are 4 friends.

Guess first: what will each program say?

What you should see: A says 500.0, and B says 500. Both look correct, right?

The reveal: it ran, and it was wrong

Now a fifth friend joins, and the bill stays the same. In the code above, on the line marked # edit here, change 4 to 5 and run it again.

A fifth friend pulls up a chair
Same bill. One more friend.
What you should seeA says: 400.0 B says: 500

A now says 400, but B still says 500. Did you find it? Program B never followed the rule; it only matched last week's answer.

No crash. No error. Still wrong.
Nothing crashed and no error came. The program ran perfectly, and it was still wrong. Someone at that table pays from his own pocket, and nobody knows why.

The only person who can catch it is someone who can read those two lines.

The auto ride

Let's try to understand this another way. Say you took an auto to go somewhere new, and the driver takes a turn you have never seen. If you know the road, you ask him why. If you don't, you simply pay the meter.

An auto-rickshaw with its meter Your usual way, and the turn you never saw
Know the road, and you ask why. Don't, and you pay the meter.

Code works the same way: if you cannot read the road, you will not notice the wrong turn.

Reading the code an AI wrote, and judging it line by line, is what we call code review.

So with Generative AI, your job does not disappear; it shifts, from typing the code to reading it and judging it.

Agentic AI: the fresher

Agentic AI goes one step further. An agent does not stop at writing code: it plans, picks a tool, acts, checks the result, and goes again.

So if an AI can do all of this on its own, do you need to know even less?

Say you joined a company as a fresher. You get a role, an objective and some tools. That, effectively, is what an agent is.

A fresher on day one: ID badge, laptop, a role, an objective, some tools

Would any team lead give a fresher full access on day one, without checking the work? No, right? Someone who knows the job checks the work, and with agents, that someone is you.

A team lead checking the fresher's work, line by line

To check the work, you must know the job yourself. This is what we call keeping a human in the loop.

What coding really trains

So what does knowing the job really mean? A program is a set of well-defined instructions, and learning to code trains you to think in exact steps, with no ambiguity.

That same skill makes your prompts sharp, because a vague instruction gets you a vague program.

In a nutshell, the AI types faster than you, but you decide what is right.

True even if the AI becomes perfect
This does not depend on the AI being weak. Even if it writes perfect code one day, someone still has to say exactly what is needed, and someone has to judge whether it was done right.

The honest cost

Deciding what is right is a skill, and every skill has a cost. Learning to code takes time, and you will fail many times. There is no shortcut around it, and I am not going to pretend there is one.

Not every problem needs code, or an agent, either. Start with the problem, then pick the tool: fit-for-purpose thinking, not trend-first thinking.

The takeaway

  1. An AI writes code fast, and it writes both right and wrong code. The wrong code can run without a single error.
  2. Your job shifts from typing the code to reading it and judging it, and with agents, to checking their work.
  3. Learning to code trains you to think in exact steps, so you can say what is needed and judge what you get.

So an AI can write the code. But you still need to understand what that code is supposed to do, and whether it is correct.

Paste this into any AI appWrite a short Python program that splits a dinner bill equally among friends, after adding a tip.