DEV Community

Discussion on: Daily Developer Jokes - Sunday, May 23, 2021

Collapse
 
jcubic profile image
Jakub T. Jankiewicz

You write that joke wrong. It's a pretty known joke and it goes like this:

Q: What are the two most difficult problems in computer science.
A: Naming things, cache invalidation, and off-by-one errors.

Off by one error is always when you got more than the limit (because of 0 indexed arrays), not less than the limit like in your example. The joke is credited to Leon Bambrick on Twitter.

Collapse
 
jayjeckel profile image
Jay Jeckel

There is nothing in the definition of the error that says it has to be over the limit. As long as it is off by one, above or below, then it is an OBOE.

Collapse
 
jcubic profile image
Jakub T. Jankiewicz

Yes, you're right en.wikipedia.org/wiki/Off-by-one_e..., but the joke is pretty known and you get it wrong.