What AI can (and can't) do with code

Beginner · 6 min · Set realistic expectations for AI code generation and name where verification must sit.

  • coding
  • evaluation

AI code generation is a fast writing assistant for code: it produces plausible, often runnable drafts of small, precisely described tasks — and it verifies nothing. Reliability comes from your verification, not the model’s confidence. Knowing where each side’s strength ends is the whole skill.

What it does well

The four limits that stay

  1. No guarantee. Fluent code compiles, runs sometimes, is not necessarily correct — edge cases (empty inputs, odd file names, missing folders) are exactly where drafts fail quietly. Same mechanism as why AI makes things up, wearing a compiler.
  2. No context — only what fits its context window. It cannot see your files, versions or settings; whatever you do not state gets assumed silently — the describe-don’t-guess rule applies twice here.
  3. No responsibility. It cannot test in your environment or own the outcome. It will also never tell you it did not test.
  4. No fresh knowledge by default — its training cutoff never moves. Libraries change; a plausible call may be two versions old. Version facts follow the search-vs-generation rule.

The cost center is review

Generation is fast; review is the bottleneck. Code you cannot read is code you cannot trust: either you understand what each line does, or you keep the task small enough to verify by behavior — a copy folder, fake files, known results. Both paths work. Skipping both does not.

A bad example

Ask: “Write a script that cleans up our production database.”

Vague input, destructive output, and “cleans up” is not a specification — it is a wish with a delete statement inside.

A better example

Ask: “Write a script that, given a folder path, lists every file older than 30 days with its size — read-only, delete nothing. I’ll run it on a test folder first.”

Start read-only, verify the list, and only then consider a second step that acts. Small steps you can check beat one big step you have to trust.

Practice

Choose the right coding task

You are not a programmer. You want AI help with something small, and you are deciding which kind of task fits what code generation actually does well on a first pass.

Pick the task that fits AI code generation well — as a draft to review.

Choose one option
Hint

Which task has a small, checkable outcome?

Which tasks ask for guarantees or judgment rather than a draft?

Transfer

Next

Next: Describe, vet, never blind-run — the review pass that makes generated code safe to execute.