AI coding assistants moved from autocomplete to something closer to delegation. They read a repository, plan a change across several files, run the tests and iterate. That is a genuinely different tool from the one that finished your line in 2023, and it needs a different way of working.
This is about that practice rather than which product to buy. Tool rankings date within months and every vendor's benchmark favours their own product. How you review the output stays useful much longer.
Where assistants are genuinely strong
- Code you have written a hundred times. CRUD endpoints, form validation, migrations, test scaffolding. Well-represented patterns, low ambiguity.
- Translation between forms. A JSON payload into a typed interface, a cURL command into a client, one test framework's syntax into another's. Mechanical, verifiable work.
- Unfamiliar syntax you understand conceptually. You know what a debounced resize observer should do; you do not want to relearn the API each time.
- The first draft of a test suite. Enumerating cases is tedious and assistants are good at breadth. You still decide which cases matter.
- Explaining code you did not write. Often the highest-value use, and the least discussed. "What does this regex do" beats an afternoon of staring.
Where they fail, and how the failure looks
The failure mode that matters is not gibberish. It is plausible code that is subtly wrong — correct syntax, sensible names, a real bug. That is much harder to catch than an obvious error, because it passes the glance test.
- Invented APIs. A method that should exist, on a library that does not have it. The name is often better than the real one, which is exactly why it slips through.
- Outdated patterns. Training data skews toward what was common, not what is current. Expect v4 syntax for a v5 library unless you say otherwise.
- Missing edge cases. The happy path is usually right. Empty arrays, concurrent writes, partial failures and timezone boundaries frequently are not.
- Confident wrongness. There is no tonal difference between an answer that is correct and one that is invented. You cannot use confidence as a signal.
- Local consistency, global inconsistency. Each file looks reasonable; together they duplicate logic three ways because the model saw them separately.
Reviewing generated code
The single most important habit: review generated code more carefully than a colleague's, not less. A colleague shares your context and will tell you when they are unsure. The model has neither property.
| Check | Why it matters |
|---|---|
| Does every API called actually exist? | Invented methods are the most common failure |
| Are versions current? | Training data skews old; check against the docs |
| What happens with empty, null or huge input? | Edge cases are where generated code breaks |
| Is user input parameterised? | String-built SQL is a recurring generated pattern |
| Does this duplicate something we have? | The model cannot see your whole codebase |
| Do the tests assert behaviour or restate the code? | Generated tests often just mirror the implementation |
That last row deserves attention. A generated test that asserts the function does what the function does will pass forever and catch nothing:
// Useless — restates the implementation
it('calls the formatter', () => {
const spy = vi.spyOn(utils, 'format')
renderPrice(10)
expect(spy).toHaveBeenCalled()
})
// Useful — asserts observable behaviour
it('renders prices to two decimal places', () => {
expect(renderPrice(10)).toBe('$10.00')
expect(renderPrice(9.999)).toBe('$10.00')
expect(renderPrice(0)).toBe('$0.00')
})
Security
Two distinct risks, often conflated.
Insecure generated code. Models reproduce common patterns, and common is not the same as safe. String-concatenated SQL, missing authorisation checks on an endpoint, secrets in source, weak randomness for tokens. All appear in generated output because all appear widely in training data.
What you send. Pasting a file into an assistant sends it to a third party. Know your tool's data policy before that file contains customer records, credentials or anything under contract. This is an organisational decision, not an individual one.
// Generated, and wrong
const query = `SELECT * FROM users WHERE email = '${email}'`
// Correct
const query = 'SELECT * FROM users WHERE email = ?'
db.query(query, [email])
Assistants are not exempt from your existing controls. Keep the linter, the dependency scanner and code review exactly as they were — arguably tightened, since the volume of code arriving for review has gone up.
What not to delegate
- Architecture. An assistant will happily produce a plausible design for a system whose constraints it cannot know — your team size, your deadline, what already broke last year.
- Security-critical logic. Authentication, authorisation, payment handling, cryptography. Use it to explain and review; own the decisions.
- Code you cannot evaluate. If you could not tell whether it is right, you cannot ship it responsibly. This is the honest limit on how far ahead of your own knowledge you can work.
- Anything where being wrong is expensive and quiet. Financial calculations, data migrations, deletion logic. Failures that go unnoticed are the dangerous ones.
Working well with them
Give the constraints up front. "Laravel 12, PHP 8.2, no new dependencies, must work on SQLite locally and MySQL in production" removes most wrong answers before they are written.
Ask for the approach before the code. Reviewing a three-line plan is faster than reviewing two hundred lines built on a wrong assumption.
Work in small pieces. A large change is hard to review, and generated code is exactly what you should be reviewing hardest.
Make it prove things. Ask for the test that fails first. Ask it to run the suite. Verifiable output beats confident output.
Push back. If something looks wrong, say so. A useful assistant should reconsider rather than agree with whoever spoke last — and if it caves instantly on a correct point, that tells you something about how much weight to give its agreement generally.
On productivity claims
You will see very large numbers. Treat them carefully: they usually measure code produced, not working software delivered, and they rarely count review time, debugging time, or the cost of a subtle bug reaching production.
The realistic position is that assistants meaningfully speed up well-understood work and help far less with the hard part — deciding what to build and why. That is still valuable. It is just not the same claim.
Frequently asked questions
Will AI replace software developers?
Not on current evidence. Assistants are strong at producing code and weak at deciding what should be built, negotiating constraints and owning consequences. The work shifts toward specification and review rather than disappearing.
How do I review AI-generated code properly?
More carefully than a colleague's, not less. Verify every API exists, check versions against the docs, probe empty and null inputs, confirm user input is parameterised, and check the code does not duplicate something you already have.
Is AI-generated code secure?
Not inherently. Models reproduce common patterns, and common is not safe — string-built SQL, missing authorisation checks and secrets in source all appear. Keep your linter, dependency scanner and review process fully in place.
What should I never delegate to an AI assistant?
Architecture decisions, security-critical logic, and anything you could not evaluate yourself. Also anything where being wrong is expensive and easy to miss, such as financial calculations and data migrations.
Why does the assistant invent functions that do not exist?
It predicts plausible code, and a well-named method that ought to exist is highly plausible. Invented APIs are the most common failure, so checking every call against real documentation is the highest-value review step.
Do AI assistants make junior developers worse?
They can, if used to skip understanding. The risk is shipping code you cannot evaluate. Used to explain unfamiliar code and to review your own, they accelerate learning instead — the difference is whether you can still tell right from wrong afterwards.
Is it safe to paste company code into an AI tool?
It depends entirely on the tool's data policy and your obligations. Anything you send goes to a third party. Decide this at an organisational level before customer data, credentials or contractual material is involved.
How much faster do AI assistants actually make you?
Meaningfully faster on well-understood, repetitive work; much less so on genuinely hard problems. Be sceptical of large headline figures — they typically measure code produced rather than working software delivered, and rarely subtract review and debugging time.
Comments (0)
Leave a Comment
No comments yet. Be the first to share your thoughts!