AI Coding Assistants
Gen AI · Multimodal & Applied AI
Theory
AI coding assistants suggest, write, explain and sometimes directly edit code, either as autocomplete inside an editor, as a chat beside your code, or as an agent that can read files, run commands and tests, and propose changes across a project. They are trained on large amounts of public code and documentation, so they are strong at common patterns.
They work well for boilerplate, unit tests, explaining unfamiliar code or error messages, translating between languages (for example SQL to pandas) and drafting a described feature. They still need review: they produce plausible code, which can compile and even run but still contain subtle logic errors, security holes, invented functions or a misunderstanding of your requirements. Treat the output as a strong first draft and keep tests as the safety net.
Why we use it
They remove much of the typing and searching in programming, help you learn unfamiliar libraries faster and make writing tests cheap, so you can spend more time on design and checking correctness.
When to use it
Use them for drafts, refactors, tests, explanations and repetitive code. Be most careful with security-sensitive code, data deletions, financial logic and anything you cannot test; never paste secrets or restricted data into a tool your organisation has not approved.
How it works
- Describe the task with context and constraints
- Assistant drafts or edits the code
- Run the tests and linters
- Tests pass and diff makes sense? Yes: Review security, then commit. No: Share the failure, ask for a fix.
- Add tests for any new behaviour
- Merge after human review
Example
Developer prompt inside editor: "Add input validation to this function so it rejects negative ages."
Assistant generates:
def set_age(self, age):
if age < 0:
raise ValueError("Age cannot be negative")
self.age = age
— correct-looking, but the developer still reviews: does this match the rest of the codebase’s error-handling convention?Key points
- Great for boilerplate, tests, refactors and explaining unfamiliar code
- Still requires review: can confidently produce subtly wrong code
- May invent functions or library options that do not exist
- Tests are the safety net: ask the assistant to write them too
- Do not paste secrets or restricted data into unapproved tools