off-by-one

Loop iteration mistake

Off-by-one describes an error where a count or index is wrong by exactly one—typically from confusion about whether to start at zero or one, or whether a boundary is included.

The loop ran eleven times instead of ten—classic off-by-one error.

Programmers encounter these constantly when working with arrays and loops.

Sometimes shortened to OBOE.

programming

fencepost

Upright fence support

  • indexAlphabetical guide to contents
  • arrayOrdered collection or display
  • loopCurve closing on itself

boundary · iteration · bug · error · buffer · overflow · underflow · debugging · compiler · segfault

fencepost

posts

Published online content

segments · endpoints · inclusive · exclusive · fence · wires · sections · span · beginning · ending

timing

synchronization

Aligning timing across systems

  • clockDevice displaying time
  • driftGradual movement, no direction
  • skewTwist from straight

latency · frame · tick · timestamp · millisecond · delay · scheduling · timeout · heartbeat · polling

Opposites
correctness

off-by-oneexact

Perfectly correct, no deviation

correct · precise · accurate · spot-on · dead-on

error magnitude

off-by-oneway off

Extremely inaccurate

error type

off-by-onelogic error

Mistake in reasoning

type error · race condition · syntax error · infinite loop · memory leak

Family

off, by, one, offing

Familiarity
Top 1,000,000
Profile
Used worldwide · Timeless · Abstract · Rated G