From: "Mills Thomas (app1tam)" Date: 2003-08-21T05:52:43+09:00 Subject: Re: Punctuation as noise > -----Original Message----- > From: Hal E. Fulton [mailto:hal9000@hypermetrics.com] > Sent: Wednesday, August 20, 2003 1:49 PM > To: ruby-talk@ruby-lang.org > Subject: Punctuation as noise > > > I've been thinking for a day or so about > signal vs. noise,,, in source code and > perhaps in other contexts (ahem!!). > My grandfather was a student of language and a teacher. He told me once that punctuation (in writings representing English) exist to tell the reader when to insert dead air (pauses or breaths). These reveal information to listeners. Spoken example: "If you don't stop eating fat will be your punishment." vs. "If you don't stop, eating fat will be your punishment." vs. "If you don't stop eating, fat will be your punishment." The first is ambiguous without the comma. The other two use the comma and disambiguate by describing pauses. The whole point is to get information across to the listener. In code, parenthesis serve to tell some receiver (human or compiler) what you meant. Sometimes people just need help understanding what you meant. Sometimes, the human is you. Sometimes you have to disambiguate for the compiler. Sometimes the compiler needs no help. What you are calling noise, Claude Shannon would call increasing the amplitude of the signal (saying something twice) to overcome noise (which is ambiguity for a compiler, or incomprehension for a human). According to Claude Shannon and the Theory of Information, pure information is indistinguishable from noise. Context is everything. > This is just a crazy theory of mine, so > flame away if you like. > > I personally find that the more "littered" > a program is with punctuation and symbols, > the less I like to look at it. (Yes, it's > possible to have *too little* of that, but > that's rare in programming languages.) > In this case, your personal noise level has dropped. You don't need such a strong signal when reading code. Analogy: you're riding in the car down the highway with the radio blasting. Park the car, come back to it later, and turn it on. What happens? The radio seems too loud. But while all the road noise is going on, the radio seemed fine. One common technique used in code obfuscation contests is to squeeze code (reduce signal) down to the smallest level the compiler can still understand. Drew