[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Der Fickfinger im Betreff

* Wau Holland wrote:
>Umgekehrt brachte Lutz Schicht  8 auf, mit den Worten von
>Holger Reif: das, was der Anwender wirklich will.

Dazu muß man historisch korrekt bemerken, daß es sich hier um einen
einfachen Obi-Wan Error handelt.


  obi-wan error /oh'bee-won er'*r/ /n./ 
    [RPI, from off-by-one' and the Obi-Wan Kenobi character in "Star Wars"]
    A loop of some sort in which the index is off by 1. Common when the
    index should have started from 0 but instead started from 1. A kind of
    off-by-one error. See also zeroth.

  off-by-one error /n./ 
    Exceedingly common error induced in many ways, such as by starting at 0
    when you should have started at 1 or vice-versa, or by writing < N
    instead of <= N or vice-versa. Also applied to giving something to the
    person next to the one who should have gotten it. Often confounded with
    fencepost error, which is properly a particular subtype of it.

  zeroth /zee'rohth/ /adj./ 
    First. Among software designers, comes from C's and LISP's 0-based
    indexing of arrays. Hardware people also tend to start counting at 0
    instead of 1; this is natural since, e.g., the 256 states of 8 bits
    correspond to the binary numbers 0, 1, ..., 255 and the digital devices
    known as counters' count in this way.

    Hackers and computer scientists often like to call the first chapter of
    a publication chapter 0', especially if it is of an introductory nature
    (one of the classic instances was in the First Edition of K&R). In
    recent years this trait has also been observed among many pure
    mathematicians (who have an independent tradition of numbering from 0).
    Zero-based numbering tends to reduce fencepost errors, though it cannot
    eliminate them entirely.

  fencepost error /n./ 
    1. A problem with the discrete equivalent of a boundary condition, often
       exhibited in programs by iterative loops. From the following problem:
       "If you build a fence 100 feet long with posts 10 feet apart, how
       many posts do you need?" (Either 9 or 11 is a better answer than the
       obvious 10.) For example, suppose you have a long list or array of
       items, and want to process items m through n; how many items are
       there? The obvious answer is n - m, but that is off by one; the right
       answer is n - m + 1. A program that used the obvious' formula would
       have a fencepost error in it. See also zeroth and off-by-one error,
       and note that not all off-by-one errors are fencepost errors. The
       game of Musical Chairs involves a catastrophic off-by-one error where
       N people try to sit in N - 1 chairs, but it's not a fencepost error.
       Fencepost errors come from counting things rather than the spaces
       between them, or vice versa, or by neglecting to consider whether one
       should count one or both ends of a row.
    2. [rare] An error induced by unexpected regularities in input values,
       which can (for instance) completely thwart a theoretically efficient
       binary tree or hash table implementation. (The error here involves
       the difference between expected and worst case behaviors of an

PS: Zur Versöhnung: