Skip to content
intermediate

LLMs in Coding and Development

An LLM can draft a working function in seconds. The harder truth is that the code it writes still needs to be tested, debugged, and understood before it…

Published 2026-09-07Updated 2026-09-128 min read
A sleek chrome robot sculpture stands against a bright blue sky background.
A sleek chrome robot sculpture stands against a bright blue sky background. Photo by Sun God Apolo on Pexels.

An LLM can draft a working function in seconds. The harder truth is that the code it writes still needs to be tested, debugged, and understood before it ships. That gap between the impressive demo and the daily reality is the most useful thing to grasp about LLMs in coding.

The common misconception is that coding with LLMs means outsourcing your thinking. It does not. The model handles the drafting; you own the judgment. Think of it as a fast, knowledgeable intern who never sleeps — not an oracle. The intern drafts, you decide, and you always verify.

What LLMs actually do in a developer's workflow

Strip away the hype and an LLM is doing one thing: predicting the next token in a sequence. Writing code is largely stringing tokens together in the right order, which is why these models turn out to be genuinely useful for programming.

In practice, that mechanism translates into several real jobs:

  • Generating and completing code — turning a described task into a function, or filling in the next lines inside your editor.
  • Explaining unfamiliar code — summarizing what a function, file, or library actually does.
  • Suggesting fixes — taking an error message and proposing a likely cause and remedy.
  • Writing tests and documentation — producing docstrings, comments, and test scaffolding.
  • Translating between languages or frameworks — moving logic from Python to JavaScript, or from one library to another.

The honest boundary: LLMs are strongest at well-defined, popular, well-documented tasks. They are weakest at novel, project-specific, or convention-heavy work where the answer depends on context the model cannot see.

Knowledge check

Check your understanding

Answer this question before you continue.

Which description best matches the article's view of an LLM in a developer's workflow?
Comparison Reasoning

Focus: Distinguish the LLM's drafting role from the developer's judgment and verification role.

The verification loop: how LLM coding actually works

A five-stage circular workflow: define behavior, supply focused context, generate a small change, run the code, and inspect evidence; an arrow returns from inspecting evidence to defining the next attempt.
An LLM drafts the change, but execution evidence and developer judgment drive each next iteration.

Here is the mental model that ties everything together: an LLM coding workflow is a context-and-verification loop, not a one-shot magic trick.

The loop has five steps:

  1. Define the expected behavior. What should the code do? What inputs will it receive? What counts as success?
  2. Supply focused context. Give the model the relevant function, file, or error — not your entire project.
  3. Generate a small change. Ask for the narrowest useful draft or fix.
  4. Run it. Execute the code against a real input or test.
  5. Inspect the evidence. Read the error, check the output, and decide whether the behavior matches your expectation.

Then repeat. Each failed run is not a dead end — it is feedback that sharpens the next attempt.

A concrete debugging example shows the loop in action. Say you hit a confusing error in a Python script. You paste the traceback and the relevant function into a chat interface and ask what is going wrong. The model points to a likely culprit — maybe a variable that is None when you expect a list. That saves you twenty minutes of staring.

But the loop does not end there. You run the suggested fix against your actual data. The traceback disappears, but the output is still wrong — the function now returns an empty list instead of raising an error. That new evidence tells you the real problem is upstream: the variable was never populated in the first place. You feed that observation back into the conversation, and the model revises its approach.

The model guessed based on the snippet you gave it. You have the full picture. Execution output is feedback, not automatic proof that the next suggestion is correct.

Common mistake: Pasting a failure back into the model without inspecting the evidence first. Read the error. Trace the state. Then ask for the fix.

Knowledge check

Check your understanding

Answer this question before you continue.

An LLM's suggested fix removes a traceback, but the function now returns an empty list instead of raising the expected error. What should the developer do next?
Scenario Interpretation

Focus: Apply the context-and-verification loop to an iterative debugging situation.

Where LLMs shine — and where they quietly fail

The decision boundary matters more than the feature list. Lean on an LLM when the task is common and well-documented. Be suspicious when it is not.

Strong territory: popular languages and frameworks, standard patterns, small self-contained functions, boilerplate, and anything with many public examples. If millions of similar functions exist on the internet, the model has seen them.

Weak territory: large unfamiliar codebases, project-specific conventions, edge cases, security-sensitive logic, and anything where the surrounding context matters. The model only sees what you give it. It does not know your whole repository, your team's style, or the hidden requirements that never made it into a ticket.

The failure modes are quietly expensive. The model can be confident and wrong. It can hallucinate a library API that does not exist. It can produce subtle logic errors that look correct at a glance and break at runtime. The code passes inspection and fails execution.

Warning: The model can draft, but you must verify. If you have not run the code, you do not have a working system.

Knowledge check

Check your understanding

Answer this question before you continue.

Which task is the strongest fit for relying on an LLM's draft, while still verifying the result?
Comparison Reasoning

Focus: Choose when to rely on an LLM based on task familiarity, context, and risk.

How to prompt an LLM for better code

The quality of what you get back depends less on clever prompt formulas than on how you frame the task. The pattern that works: treat the model like a digital intern hired to type code from your detailed instructions.

Give it a focused, specific task instead of dumping a whole project. Name the language, the function, the inputs, and the expected behavior. Include the relevant code snippet rather than the entire repository — the model works best with a small, targeted context.

State your constraints explicitly. Performance needs, error handling, style preferences, the library you want used — put them in the request. A vague "fix this" produces a guess. A precise "rewrite this function to handle empty input and return a default value" produces something you can actually use.

Iterate like a conversation. Get a simpler version working first, then refine toward the full implementation. And when a conversation stops being useful, start a fresh one. Context accumulates and can steer the model off course.

Tip: For complex tasks, ask for a working prototype first. Prove the core requirement can be met, then build out the sophistication.

Knowledge check

Check your understanding

Answer this question before you continue.

A developer wants a useful revision of a function. Which request follows the article's prompting guidance?
Misconception Check

Focus: Identify the prompt details that make an LLM coding request more actionable.

Choosing the right tool for the job

AI coding tools come in different shapes, and the shape should match the task. The real difference between them is not the model behind the scenes — it is who supplies the context, what actions the tool can take, and who verifies the result.

Tool shapeContext sourceWhat it can doVerification boundary
Chat interfaceWhat you paste inExplain, draft, answer questionsYou run and inspect everything
Editor-integrated toolYour current file and sessionComplete code, suggest in-place editsYou run and inspect everything
Agent-style toolFiles, commands, and prior steps it gathersIterate, run code, fix its own outputYou review what it changed and why

Chat interfaces — the web or app versions of tools like ChatGPT and Claude — are good for explaining code, drafting functions, and one-off questions. You control exactly what context goes in, which makes them ideal for learning.

Editor-integrated tools — like Copilot or Cursor — pull context from your current file and session automatically. They shine at completion and in-place edits where the surrounding code matters.

Agent-style tools can iterate, run code, and fix their own output. They are powerful but demand more oversight and a clearer task boundary. An agent is not a colleague with independent judgment — it is a workflow that lets the model take multiple tool-using steps. You still define what success looks like and check the final result.

My advice for beginners: start in a chat interface where you can see exactly what context goes in. Once you understand the pattern, move to editor tools that automate the context-gathering for you.

Common mistakes beginners make with coding LLMs

The most expensive mistakes are consistent across every beginner I have watched learn this:

  • Trusting output without running it. The single most common and most costly error. The model's confident tone is not evidence of correctness.
  • Pasting an entire codebase and expecting useful help. Isolate the relevant function or file instead.
  • Asking vague questions. "Fix this" tells the model nothing about intended behavior or constraints.
  • Using the model as a substitute for understanding. If you cannot judge or repair what it produces, you cannot ship it.
  • Treating confidence as correctness. LLMs are masters of the known, not pioneers of the unknown.

Your first step toward coding with LLMs

Start small and real. Take a function you wrote or are studying, paste it into a chat interface, and ask the model to explain it line by line. Then ask it to suggest one improvement. Compare its suggestion to what you would write.

Then try a generation task. Describe a small, well-defined function in plain language — inputs, expected behavior, edge cases — and compare the model's draft to your own version.

The habit that matters most: run whatever the model produces and verify it behaves as expected. That single discipline separates developers who use LLMs well from developers who get burned by them.

The developer's real job — judgment, testing, and ownership of the outcome — does not disappear when an LLM enters the workflow. It becomes more important. The model drafts, you decide, and you always verify.

Once you have this foundation, the natural next direction is building systems that give LLMs more context and capability — retrieval-augmented generation and agents. That is where coding with LLMs moves from helpful autocomplete to a tool that can gather its own evidence. The verification loop you practice here is exactly the skill those systems demand.

Knowledge check

Final check

Finish the article by checking the ideas you just learned.

Which comparison of coding-tool shapes matches the article?
Question 1 of 2Comparison Reasoning

Focus: Compare coding-tool shapes by their context sources and verification boundaries.

A beginner asks an LLM to generate a small function. Which workflow best follows the article's recommendation?
Question 2 of 2Scenario Interpretation

Focus: Apply the article's recommended first-step workflow and verification discipline.

References

  1. Here's how I use LLMs to help me write codesimonwillison.net
  2. Illuminating LLM Coding Agents: Visual Analytics for Deeper Understanding and Enhancementarxiv.org
8sources checked
8source domains
6searches run

Research updated Sep 7, 2026

Keep learning

Related tutorials

Continue with nearby topics and beginner-friendly explanations.

A serene beach with soft sand, gentle waves, and lush green trees. Perfect for a nature escape.
intermediate
10 min read

LLM Career Paths

Most people assume a career in large language models means training models from scratch—years inside a research lab, clusters of GPUs, and published…

Read tutorial