From: "Hal E. Fulton" Date: 2003-08-21T04:20:16+09:00 Subject: Re: Punctuation as noise ----- Original Message ----- From: "Michael Campbell" To: "ruby-talk ML" Sent: Wednesday, August 20, 2003 1:50 PM Subject: Re: Punctuation as noise > > I have noticed an odd effect already, though. The > > symbol/alpha ratio is fairly low (1-2) for smaller > > programs and larger (4-6) for larger programs. I've > > tried it on sources ranging from 10 lines to 2000 > > lines. > > In my scrpts directory, I have a half dozen each very small ruby and perl > scripts. For the ruby stuff I got s:n of 2.4. For the perl stuff 2.7. That's interesting and surprising to me. Not only are they very comparable, but Ruby actually has a smaller value.Wonder if they'd diverge more on larger sources? By the way, when I said symbol/alpha ratio, I really meant alpha/symbol ratio (as the code reflects). Thus (to me) a higher number is a prettier chunk of code. > Note: I use some old-habit stuff from perl and c, so I might slip in a > semicolon on EOL and I definitely avoid "poetry" mode at all costs > (including not using parens around if conditions), as it's Vogon poetry to > my eyes, so my ruby probably isn't idiomatic ruby; or at least not as RUBY > idiomatic ruby as is yours. I use "poetry mode" frequently but not universally. And the absence of parens on an if is (to my mind) not even considered poetry mode. It's just avoidance of superfluous parens around an expression, just as I don't say: x = (y + z) My style deviates from the norm in many cases. Often I'm trying to smooth those out. _The Ruby Way_ contains numerous examples of camelCase, as I hadn't trained myself not to like it. It's a matter of opinion anyway; and we don't HAVE to code exactly the way Matz does. So I'm uncertain what "idiomatic Ruby" really is. Anyway, I'd be curious as to other people's results on this little experiment. Cheers, Hal