Skip to content
quotesby

About this quote

What does it mean?
The code advances a position pointer using a lookup table, with a comment questioning possible errors.
In plain terms
It moves forward in the string, wondering if it could break.
What can you take from it?
Check boundary conditions when using lookup tables for indexing.

Where it applies

  • parsing input
  • processing streams

Putting it to work

  • validate indices
  • add unit tests

Questions to consider

  • Where could this indexing fail?
  • How to verify correctness?

Another view

The comment admits uncertainty, indicating potential hidden bugs.

More from Larry Wall

  1. str->str_pok |= SP_FBM; /* deep magic */ s = (unsigned char*)(str->str_ptr); /* deeper magic */

    Permalink to quote #246
  2. echo 'Hmmm...you don't have Berkeley networking in libc.a...' echo 'but the Wollongong group seems to have hacked it in.

    Permalink to quote #248
  3. /* And you'll never guess what the dog had */ /* in its mouth... */

    Permalink to quote #241

Related quotes

  1. str->str_pok |= SP_FBM; /* deep magic */ s = (unsigned char*)(str->str_ptr); /* deeper magic */

    Larry WallLarry Wall quote #246
  2. /* This bit of chicanery makes a unary function followed by a parenthesis into a function with one argument, highest precedence. */

    Larry WallLarry Wall quote #264
  3. Beware of bugs in the above code; I have only proved it correct, not tried it.

    Donald KnuthDonald Knuth quote #2