Greenspun's Tenth Rule
From Wikipedia, the free encyclopedia
Greenspun's Tenth Rule of Programming is a common aphorism in computer programming and especially programming language circles. It states[1]:
Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.
Contents |
[edit] Morris's Corollary
Well-known hacker Robert Morris later added the corollary:
…including Common Lisp[2].
This can be viewed as a commentary on the difficulty of creating an efficient implementation of the extremely large and complex Common Lisp language, or simply a joke about LISP's eval function and the general commonality of recursion in functional languages. Both Greenspun's rule and Morris's corollary are examples of a characteristic style of hacker humor known as "ha ha only serious".
[edit] Origin
The rule was written sometime around 1993 by Philip Greenspun. Although it is known as his tenth rule, there are in fact no preceding rules, only the tenth. The reason for this according to Greenspun: "I just thought it sounded better to have a 10th rule, as though it were part of a comprehensive system."
[edit] Meaning
The interpretation is that programmers, constrained by low-level, primitive tools like C, often work around the limitations of their languages by inventing and implementing features found in more expressive languages such as Lisp.
[edit] Generalization
The rule is often modified by replacing "Common Lisp" with the speaker's language of choice, such as Scheme or Haskell. It can also be generalized as:
Any sufficiently complicated platform contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of a functional programming language.
This refers to complex software that is made scriptable, and then gradually evolves a more comprehensive scripting language. Examples can be user-defined functions in Microsoft Excel, HTML and ECMAScript, XSLT, and even MediaWiki through template substitution (as beta reduction)[3][4][5].