Where it clearly helps
Boilerplate and scaffolding. Translating between languages and framework versions. Explaining unfamiliar code and cryptic stack traces. Writing the tests and docstrings you were going to skip. Regexes and SQL you would otherwise reach for a reference to write. In each case verification is cheap: you run it, or you read it, and you know immediately.
Where it clearly hurts
Anything where verification is expensive. Concurrency, security-sensitive logic, migrations against production data, subtle floating-point or timezone behaviour, and any API released after the model's cutoff. The characteristic failure is not a syntax error — it is confident, plausible, idiomatic code that calls a method which has never existed.
Prompting with code
Give the model what a new colleague would need: the relevant file, the error text in full, the runtime and versions, and what you have already tried. Then state the constraint that matters — "no new dependencies", "keep it in the existing repository pattern", "must run on the edge runtime". Ask for the reasoning before the patch on anything non-trivial; it materially reduces plausible-but-wrong answers. Tools like AI Code Generator, Code Explainer and Bug Fixer ship with these instructions already in place.
Review and tests
The highest-value use is as a second reviewer, not a first author. Paste a diff and ask for edge cases, missing error handling and security concerns — framed as questions, not verdicts. Test generation is similarly strong, with one caveat: a model writing tests from your implementation will happily encode the bug as expected behaviour. Describe the intended behaviour instead of pasting the function.
A working discipline
- Never paste secrets, keys or customer data.
- Read every line before committing; generated code you have not read is technical debt with a delay fuse.
- Run it. Lint it. Type-check it.
- For anything security-relevant, assume the output is wrong until proven otherwise.
- Prefer small, reviewable generations over whole-file rewrites.