Ravindra BagaleCourses & study guides Track your progress
AI CODING ASSISTANTS · CHAPTER 1

What Is an AI Coding Assistant

An AI coding assistant is a helper inside your code editor. You tell it what you want in plain words. It writes or fixes the code. You check it and run it.

In short: it is an AI that lives in your editor, turns your words into code, and speeds up your work — but you stay in charge of reviewing and testing.

Why it matters

WHY

Writing code by hand is slow. An assistant does the boring parts fast: boilerplate, small functions, tests, fixing errors. You spend more time on the real problem. It is also a great teacher — it can explain code in simple words.

What the words mean

WHAT
  • AI coding assistant: a tool in your editor that writes code from your request.
  • LLM (large language model): the "brain" that was trained on lots of code and text.
  • Prompt: the request you type (a sentence, or a code comment).
  • Context: the files and text the assistant can see when it answers.
  • Suggestion: the code it offers; you accept or reject it.

How it works, top to bottom

1 · You type a request plain words or a comment 2 · Assistant reads context your open files + prompt 3 · AI model writes code suggestion, chat, or edits 4 · You review it read, understand, change 5 · You run and test keep only what works

The three modes

HOW

Almost every assistant works in three modes. You will switch between them all day.

  1. Inline (autocomplete): as you type, it shows faint "ghost" code. Press Tab to accept. Best for finishing a line or a small function.
  2. Chat: a side panel where you ask questions like "write a function that reads a CSV" or "why is this error happening?". Best for bigger blocks and learning.
  3. Agent: you give a goal; it edits several files and can run commands — asking your approval. Best for multi-step tasks. More power means more care.
COMPARISON CARDAI Coding

Chat vs Inline vs Agent

Inline: grey ghost text as you type; press Tab to accept.
Chat: you ask in a side panel; it explains or writes blocks.
Agent: it edits many files and runs commands, with your approval.
Ravindra Bagale · ravindrabagale.com/ai-coding

How to prompt for code (simple rules)

  1. Say the goal + the inputs + the output. "Write a Python function that takes a list of numbers and returns the average."
  2. Name the language and tools. "Use pandas." "No external libraries."
  3. Give an example of input and expected output when you can.
  4. Ask for small pieces, then build up. Short requests give better code.

Always review and test AI code

  1. Read it line by line. If you do not understand a line, ask the assistant to explain it.
  2. Run it on a small example and check the result.
  3. Write a test (you can ask the AI for one) and run it.
  4. Watch for made-up things — AI can invent function names or libraries that do not exist. Check the docs.
Rule: AI code can look right but be wrong. Never ship code you have not read and run.

Safety basics

  • Never paste secrets (passwords, API keys, real customer data) into a cloud assistant.
  • Check licences if it produces a large chunk that looks copied.
  • For private data, use a local model (Ollama) so nothing leaves your machine — see Keep data at yourself.

Quick quiz

1. What are the three main modes?

Inline (autocomplete), chat, and agent.

2. What must you always do with AI code?

Read it, run it, and test it before trusting it.

3. What is a "prompt"?

The request you type — a sentence or a code comment.

4. What should you never paste into a cloud assistant?

Secrets: passwords, API keys, or real customer data.

Save tokens and money

SMART AI USE

Use inline mode for small stuff (it is cheap and fast). Save chat/agent for real problems. Ask for "only the code" to get shorter answers. See more AI Coding guides.

Save these cards

INTERVIEW CARDAI Coding

What is an AI coding assistant?

Answer: a tool inside your editor that suggests, writes or edits code from your prompt, using a large language model.
Key line: it is a helper, not a replacement — you still review and test.
Ravindra Bagale · ravindrabagale.com/ai-coding
REVISION CARDAI Coding

AI assistant in 3 ideas

1 Input: your prompt + the code it can see.
2 Output: suggestions you accept or reject.
3 Rule: always read and test before you trust it.
Ravindra Bagale · ravindrabagale.com/ai-coding