Article development led by
queue.acm.org
Until our programming languages
catch up, code will be full of horrors.
BY PouL-henninG KamP
my Compiler
Does not
understand me
onLY LATeLY—and after a long wait—have a lot of smart
people found audiences for making sound points
about what and how we code. Various colleagues have
been beating drums and heads together for ages trying
to make certain that wise insights about programming
stick to neurons. Articles on coding style in this and
other publications have provided further examples of such advocacy.
As with many other educational ef-
forts, examples that are used to make
certain points are, for the most part,
good examples: clear, illustrative, and
easy to understand. Unfortunately,
the flame kindled by an article read
over the weekend often lasts only
until Monday morning rolls around
when real-world code appears on the
screen with a bug report that just does
not make sense—as in, “This can’t
even happen.”
When I began writing the Varnish
HTTP accelerator, one of my design
decisions—and I think one of my best
decisions—was to upgrade my OCD to
CDO, the more severe variant, where
you insist letters be sorted alphabeti-
cally. As an experiment, I pulled to-
gether a number of tricks and practic-
es I had picked up over the years and
turned them all up to 11 in the Varnish
source code. One of these tricks has
been called the red-haired stepchild
of good software engineering and is
widely shunned by most program-
mers for entirely wrong and outdated
reasons. So let me try to legitimize it
with an example.