Skip to content

Comment on A Real Life Off-by-One Errorparent

Comments

People are misunderstanding the meaning of an off-by-one error. Suppose the plan states that hold A and hold B need to be 11 holes apart. In the true spirit of the off-by-one error, this can be interpreted in 3 ways:

- either as 11 empty holes between the holds; - as 11 holes, start counting 1 just above hold A; - or as 11 holes, start counting with hold A as number 1.

Another real-life example, is a plumber who tells the construction worker that the distance between the holes for hot and cold water needs to be 15 cm. This was meant to be measured center to center, but the constructor worker interpreted it as the distance from the right side of the first hole to the left side of the second. The result can still be admired in our house, 10 years later.

I might be splitting hairs now. Is not ambiguity the problem in your examples, and not any off-by-one error? If the respective ambiguities were resolved then there should be no off-by-one errors.

Of course use of expressions may vary. My in-spirit-meaning of ‘off-bye-one error’ may differ from yours, and that is fine. (Had it really mattered in a discussion then we would simply agree to find a suitable definition of the expression.)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.