skip to content

You accept an inline suggestion with one keystroke - what can you actually check in that moment?

level: middleimportance: should knowfreq 50%

answer

  1. Accepting is a decision, not a delay
  2. Triage, not review
  3. Rejecting costs a line of typing
  4. Nothing marks it afterwards
  5. You cannot check a caller from here

basics

~20 s

Enough to triage, not to review: whether it does what you were about to write, and whether its names exist here. Anything you cannot settle in that moment should be rejected rather than accepted to check later.

solid answer

~40 s

Accepting is a decision, and it is taken hundreds of times a day at a speed that allows only a few checks. In the moment you can ask whether the suggestion is doing the thing you were about to write, whether the names in it are names that exist here, and whether it is longer than you have actually read. You cannot, at that speed, settle whether it matches a caller elsewhere, whether an edge case is handled, or whether something equivalent already exists. So treat accepting as triage, and reject whatever you cannot triage: the cost of a wrong rejection is typing the line yourself, while the cost of a wrong acceptance is that the line stops looking like a suggestion at all. Once accepted, nothing in the file marks it.

go deeper

for a junior

Treat the accept keystroke as a decision you own. If you have not read the suggestion, reject it - you can always type the line, and you will type it faster than you will later explain it.

for a middle

Separate what the moment allows from what it does not: intent and familiar names, yes; callers elsewhere, edge cases and duplication, no. Then say where the deferred check actually happens.

for a senior

Show that you set the default deliberately - reject on doubt - and that you know why: a rejected suggestion costs a line of typing, while an accepted one enters the change with nothing marking it as anything but yours.

for a principal

Own the point that this decision is taken far more often than any review decision and at far less notice. Any discipline a team wants around machine-assisted code has to survive being applied hundreds of times a day, or it is not a discipline.

## Accepting is a decision, not a pause in one The keystroke that takes a suggestion is the most frequent decision in this whole subject. It is made far more often than any review decision, at far less notice, and usually while you are holding something else in your head. Treating it as a decision - rather than as a way of deferring one - is most of the discipline. The reason it matters is not that suggestions are especially bad. It is that **an accepted suggestion stops being a suggestion**. In the file it is indistinguishable from what you typed; the line carries no marker; the change shows one author. Unless you leave a marker yourself, the only record that you meant to come back is your own memory, and that record does not survive lunch. ## What the moment allows, and what it does not | check | possible at typing speed? | why | |---|---|---| | is it doing what I was about to write? | **yes** | you are already holding the intent; comparing costs nothing | | are these names ones that exist here? | **mostly** | recognition is fast, though recognising a name is not checking its meaning | | is it longer than I have actually read? | **yes** | you can see the block's size without reading it | | does it match a caller in another file? | **no** | that means leaving the line and reading elsewhere | | are the edge cases handled? | **no** | that needs the whole unit, usually its tests | | does something equivalent already exist here? | **no** | that is a deliberate search | The top half is triage. The bottom half is review, and it happens somewhere else or not at all. Which parts of that later review a build performs and which need a person is a separate subject with its own answer. ## What "reading" actually means at this speed Be honest about the check you are running. At accept time you are pattern-matching the suggestion against what you intended to write. That catches **shape** mismatches - it is doing something else, it handles a case you were not in, it is far longer than the thought you had - and it does not catch **meaning** mismatches. There is an uncomfortable corollary. The suggestions that pass this filter most easily are the ones that look most like what you expected. That is also a fair description of the suggestions most likely to be subtly wrong, because a suggestion that looks wrong gets read properly and one that looks right does not. ## The asymmetry that settles the default 1. **Wrongly rejecting** a good suggestion costs you typing the line you were going to type anyway - seconds, and a line you understand. 2. **Wrongly accepting** a bad one puts it into the unit, the commit and the review as ordinary code, with nothing distinguishing it. 3. Therefore the default on doubt is **reject**. The tool will offer again, often something shorter once you have typed the first part yourself. That asymmetry is the whole argument, and it is worth stating in an interview in exactly that form, because it explains a habit instead of merely asserting one. ## What must be deferred, and saying so honestly Triage does not replace reading the finished unit. The realistic discipline is two-tier: - **at accept time**, triage - intent, names, size; - **when the unit is finished**, read it as a whole, as a thing you are responsible for, not as a sequence of remembered suggestions. The second step is the one that actually catches meaning mismatches, and it is the one people skip because the code already feels reviewed. It does not feel reviewed because it was; it feels reviewed because you saw it once, briefly, at speed. ## A signal worth noticing If you find you are accepting without reading, the suggestions are arriving faster than you can use them. That is a real observation about your working state rather than a character failing, and the responses are mechanical: work in smaller steps, or stop taking multi-line blocks for a while. The keystroke is cheap enough that nothing warns you when it has stopped being a decision. ## Answering this in an interview Separate triage from review out loud, name what each catches, then give the asymmetry - a wrong rejection costs a line of typing, a wrong acceptance costs everything the line does afterwards with nothing marking it as anything but yours. A candidate who claims to fully review every suggestion at typing speed is describing something the speed does not allow; a candidate who says what the moment genuinely allows, and where the rest happens, is describing a practice.

  • Is rejecting a correct suggestion a loss?
    Barely. You type the line you were about to type, which is what you would have done without the tool at all. That asymmetry is the argument for rejecting on doubt: a wrong rejection costs seconds, a wrong acceptance costs whatever the line does afterwards.
  • You accepted something two hours ago and cannot remember reading it. What now?
    Read the unit it landed in, as a whole, now - not by hunting for the suggestion, because nothing distinguishes it from the rest. The lesson is upstream: the moment you notice yourself accepting without reading, suggestions are arriving faster than you can use them.

saying these in an interview costs you the question

  • Accepts whatever appears because rejecting feels wasteful
  • Treats accepting as postponing the decision rather than making one
  • Expects to be able to tell later which lines were suggested
  • Assumes anything wrong will be obvious once the function is finished
  • Believes the pause to read a suggestion costs more than it saves