Blog / Build with AI /

AI as a pair programmer: how the relationship works

The best way I’ve found to think about AI and code is this: it’s a pair programmer who types extremely fast, has read a huge amount, never gets tired, and will tell you with total confidence that something works when it doesn’t.

That’s a useful colleague. It’s also one you have to manage.

This post is my opinion on how the relationship should work, based on the way ChatGPT and similar tools behave in mid-2023 and on how I use them for web work. If you’ve read prompting for code: how to ask AI for something that actually runs, consider this the follow-up: less about the prompt, more about the partnership.

Pair programming, the human version

In traditional pair programming, two people share one task. One is the “driver”, typing. The other is the “navigator”, watching, thinking ahead, and spotting mistakes.

The point isn’t speed. It’s that two minds catch more errors than one, and explaining your thinking out loud makes it clearer.

With AI, the roles flip

When you work with a chatbot, it’s usually the driver. It types the code. You’re the navigator, and navigating is the harder job, because you need to know where you’re going.

That means your responsibilities are:

  • Knowing the destination. What should this thing do, in plain words, and how will you know it works?
  • Reading what it writes. You don’t need to understand every line, but you should understand the shape.
  • Testing. Run it. Try bad input. Try the boring case and the odd case.
  • Saying no. If it adds features you didn’t ask for, remove them.

If you hand over the steering wheel too, you end up with code nobody understands, including you.

Four rules for a good working relationship

1. Give it small tasks

“Build me a CRM” is a way to waste an evening. “Write a function that takes a list of order rows and returns the total per customer” is a task. Small steps mean small mistakes, and you can test each one.

2. Explain, then code

Before it writes anything, ask it to explain its plan. “Tell me how you’d approach this in three or four bullet points, then wait.” If the plan is wrong, you’ve lost thirty seconds rather than thirty minutes.

3. Make it explain back

When code arrives, ask: “Walk me through what this does, line by line.” Two things happen. You learn, and sometimes the explanation contradicts the code, which is how you find a bug. I’d say this is the most underrated habit in AI-assisted coding.

4. Keep a record

Chatbots lose track of long conversations (long chats drift and earlier details get lost). Keep your own notes: what the project does, which files exist, what’s decided.

Where the partner is strong

  • Boilerplate. Forms, loops, repetitive structure, regular expressions, CSS layouts.
  • Translation. “Turn this spreadsheet formula into a script” or “explain this old snippet”.
  • Naming and structure. Suggesting how to split something into functions.
  • Patience. You can ask the same basic question five times and it doesn’t sigh.

Where it’s weak

  • Anything recent. Its knowledge stops at a training cut-off, so new library versions and recent changes can be wrong.
  • Your specific setup. It doesn’t know your hosting, your plugin conflicts or the odd thing your theme does.
  • Saying “I don’t know”. It tends to produce an answer anyway.
  • Security. It’ll happily write code that works and is unsafe. The sort of thing I covered in AI-written code: five mistakes to check before you trust it.

The counter-argument

The fair objection is that this is just a fancier autocomplete, and that calling it a “partner” flatters it. It doesn’t understand anything; it predicts text.

I agree about the mechanism. But I think the practical relationship still matters. If you treat it as an oracle, you’ll trust it too much. If you treat it as a search box, you’ll under-use it. Treating it as a fast junior colleague who needs clear direction and a review is the model that gives me the best results, whatever is happening underneath.

What this means for a web admin

If you run websites, you’re probably not writing software all day. You’re writing the odd snippet, a spreadsheet script, a small tool. In that setting, an AI partner can move a task from “I’d need a developer” to “I can do this myself, carefully”. The “carefully” part is yours.

A rule I’d keep: the more damage a mistake can do, the more review the code needs. A text-cleaning script on a copy of a file? Low risk. Something that edits your live database? Test on a copy first, take a backup, and ask a human developer to look at it. That’s what a human review is for.

A short example of the rhythm

Say you want a script that renames a folder of exported images so each file name starts with the date. A good session goes roughly like this.

You describe the goal and ask for a plan. It suggests reading the files, pulling the date from each one, and renaming. You say “show me the plan only, and do nothing destructive”. Then you ask for the code, with a dry-run mode that only prints what it would rename. You run that on a copy of the folder, notice it treats files with no date badly, and say so. It fixes that. Only then do you run it for real.

Nothing in that loop is clever. It’s just plan, small step, test, correct. The speed comes from the AI typing; the safety comes from you refusing to skip the dry run.

Key takeaways

  • You’re the navigator; the AI is the driver.
  • Small tasks, explained plans, and line-by-line explanations catch most problems.
  • Keep your own notes, because the chatbot’s memory is short.
  • Match the amount of review to the amount of risk.

How do you work with it: do you let it drive, or do you stay in charge of the plan?