In Dreaming in Code I wrote a lot about the difference between ambiguity in programming, where it is often a source of trouble, and in “natural” languages (i.e., English or French or Mandarin), where it is often a source of value.
Jason Kottke points to this fascinating essay by Perl creator Larry Wall, in which Wall distinguished between “local” and “distant” ambiguities:
People thrive on ambiguity, as long as it is quickly resolved. Generally, within a natural language, ambiguity is resolved rapidly using recently spoken words and topics. Pronouns like “it” refer to things that are close by, syntactically speaking. Perl is full of little ambiguities that people never even notice because they’re resolved so rapidly. For instance, many terms and operators in Perl begin with identical characters. Perl resolves them based on whether it’s expecting to see a term or an operator, just as a person would. If you say 1 & 2, it knows that the & is a bitwise AND, but if you say &foo, it knows that you’re calling subroutine “foo”.
In contrast, many strongly typed languages have “distant” ambiguity. C++ is one of the worst in this respect, because you can look at a + b and have no idea at all what the + is doing, let alone where it’s defined. We send people to graduate school to learn to resolve distant ambiguities.
[tags]larry wall, perl, ambiguity, language, natural language, dreaming in code[/tags]
Post Revisions:
There are no revisions for this post.