AI coding assistants can write boilerplate, explain unfamiliar code and fix bugs in seconds. They can also produce confident, plausible code that is wrong. The difference usually comes down to how you work with them.
Give context, not just a request
- Say what the code is for, which framework and version you use, and any constraints.
- Point the assistant at the relevant files instead of pasting fragments.
- Keep a project instructions file, such as AGENTS.md, with conventions, commands and things to avoid.
Work in small steps
- Ask for a short plan before any code.
- Implement one piece at a time.
- Run the code or the tests after each step.
- Commit working states so you can roll back easily.
Verify everything
- Read the diff like a code review. Check edge cases, error handling and security.
- Ask for tests along with the code, and make sure they fail when the code is broken.
- Be suspicious of invented APIs and package names. Check the official docs.
Protect your secrets
Never paste API keys, passwords or customer data into prompts. Use environment variables and placeholder values instead.
Use it to learn
When the assistant writes something you do not understand, ask it to explain line by line. You will review its output faster next time and rely on it less for the basics.
A weak prompt vs a strong one
Here is the kind of request that produces generic, often wrong code: “Add login to my app.” The assistant has to guess your framework, your database, how sessions should work and where the code goes.
Compare it with: “In this Next.js app, add email and password login using the existing users table in lib/db.ts. Hash passwords with the bcrypt package that is already installed. Store the session in an HTTP-only cookie. Don’t add new dependencies. Start by listing the files you plan to change.” It takes thirty seconds longer to write and removes most of the guesswork. The final instruction, asking for a plan first, gives you a cheap chance to catch a bad approach before any code exists.
Where assistants are strongest
- Boilerplate and repetitive changes, such as adding a field across a form, an API route and a database model.
- Translating code between languages or frameworks you already understand.
- Writing tests for existing code, which also exposes behavior you didn’t know about.
- Explaining an unfamiliar codebase or error message.
Where to be extra careful
- Security-sensitive code: authentication, permissions, payments and anything that handles user input in database queries.
- Recent library versions. Assistants may suggest an API that was renamed or removed after their training data ends, so check the version you actually use.
- Performance. Code that works on ten test records can be painfully slow on ten million.
- Large refactors done in one go. Big diffs are hard to review, and that is where subtle mistakes hide.
Keep your own skills sharp
The developers who get the most out of AI tools are the ones who could write the code themselves. They spot wrong answers quickly because they know what right looks like. Treat the assistant as a fast, tireless junior colleague: great for drafts and grunt work, but every change still needs a review from someone who understands the system.
What we think
AI coding assistants are genuinely useful, but the productivity gains go to developers who give them context, work in small steps and review every change. Used carelessly, they mostly produce code that looks right and fails later.
Treat the assistant like a fast junior colleague: let it draft, let it explain, let it write tests, and keep the final judgment, especially on security, for yourself. The habit that matters most is the one that predates AI: read the diff before you merge it.