Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 9
    Are they common? I'm producing my fair share of bugs, but off-by-one errors are very rarely among them. Perhaps because I mostly use Python, i.e. use iterators instead of juggling with indices? (And: What does that tell us? ;) ) Commented Feb 2, 2011 at 18:16
  • 1
    The less you have to think about, the more productive you are? Commented Feb 2, 2011 at 18:20
  • 1
    @delnan: I agree. Off-by-one errors are usually the first to be caught when I'm coding (before I even move to an official "testing phase"). Commented Feb 2, 2011 at 18:24
  • 8
    I almost answered the previous question by mistake... Commented Feb 2, 2011 at 19:07
  • 1
    > What can we do to prevent falling prey to the off by one errors? Use an iterator. Commented Feb 3, 2011 at 0:14