AI pair programming: habits that make coding assistants actually help
By TechlyUpUpdated 2 min readSoftware developers
Quick answer
Coding assistants help most when you give them context, ask for small changes, and verify with tests. Describe the goal and constraints, point to relevant files, request one change at a time, read every line, and run tests and linters before committing. Be especially careful with security-sensitive code, dependencies, and anything you don't fully understand.
Give context like you would a colleague
State the goal, the relevant files, conventions, and constraints (“no new dependencies”, “keep the public API unchanged”). Vague requests get generic code.
Work in small steps
Small diffs are easier to review and roll back.
- Ask for a plan before code for anything non-trivial.
- Implement one step, review, test, commit.
- Ask the assistant to write or update tests alongside changes.
- Ask it to explain code you don't understand before accepting it.
Review like it's a pull request
Check edge cases, error handling, security (input validation, injection, secrets), performance, and whether it matches project conventions. Verify suggested packages actually exist and are maintained.
Keep learning
Use assistants to explore unfamiliar code and concepts, but make sure you can explain what ships. Over-reliance without understanding makes debugging much harder later.
Pair-programming anti-patterns
These make assistants slow you down in the long run.
- Accepting large multi-file changes without reading them.
- Asking the assistant to fix failing tests by changing the tests.
- Letting it add dependencies for small tasks.
- Skipping your own reasoning, so you can't debug the result later.
Worked example: adding a feature safely
A developer needs to add pagination to an API. They ask the assistant to read the relevant files and propose a plan. After adjusting the plan, they implement it in three steps: query changes with tests, API parameter handling with validation, and documentation.
Each step is reviewed and committed separately. When a reviewer questions an edge case, the developer can explain the behaviour and point to the test covering it — because they understood each step rather than accepting one large generated change.
Try it yourself
Pick a small refactor, ask the assistant for a plan first, implement it in two or three commits with tests, and note every correction you made.
Frequently asked questions
Do AI coding assistants make developers faster?
They can speed up many tasks, especially boilerplate and exploration; results vary by task and how carefully output is reviewed.
Can I trust AI-suggested dependencies?
Check that packages exist, are reputable, and are maintained. Hallucinated package names are a known risk.
Should juniors use AI assistants?
Yes, with emphasis on understanding and review; they're excellent for explanations and exploring code.
Want a suggested next step for your situation?
Share a few details and someone from TechlyUp will get back to you. No automated sequences.
Sources and further reading
Examples are authored practice material, not measured learner outcomes. Tool behavior can change. Found an error? Contact TechlyUp with the page URL and correction.