From: Rick DeNatale Date: 2008-05-31T23:45:38+09:00 Subject: Re: splitting help needed On Sat, May 31, 2008 at 8:11 AM, David A. Black wrote: > Hi -- > > On Sat, 31 May 2008, Dave Bass wrote: > >> But this is Ruby, not Perl! :-D >> >> Coming from 10 years of Perl coding, I wish Ruby were *less* Perl-like, >> as it can get confusing, especially when you're working in both >> languages at the same time. > > I remember someone (I'm too lazy to look it up) saying long ago that > while Ruby often strikes one as Perl-like initially, it actually is > much less so than it appears at first. I think that's true. Perl also > has more of a tradition of deliberate code obfuscation, though of > course it's generally done in a playful way. Obfuscated Ruby code > always looks kind of ridiculous to me, as Ruby really militates for > a certain clarity, and there's such a tradition of love of clean code > in the community. Some of the features Ruby 'stole' from Perl are things I use fairly regularly, for example the if/unless/while statement modifiers. Others such as all the special and sometimes magical global variables and pseudo-variables I don't find useful at all, and I don't see them discussed much here. They're probably quite helpful if you are using Ruby in the same kind of swiss-army knife adjunct to shell commands way that perl is often used by wrapping a 'one-liner' in one of the various loops implied by different command line options like i, n, and p, but I never use that. Regular expressions are really a sub-language of their own. Ruby has some extensions like %r{} which I think make them a little clearer. > For the first RubyConf, we were going to have a "Code De-Obfuscation" > contest, since the idea of an obfuscation contest in Ruby seemed so > against the grain of what people loved about the language. We got as > far as getting some obfuscated contributions, ripe for de-obfuscation > (including one from Dave Thomas), but unfortunately the timing of that > conference -- October 2001 -- sapped some of our time and energy and > that contest was one of the things that fell by the wayside. That sounds like a great idea. I wish that there were some kind of anti-code-golf contest, where the objective was maximum clarity/expressiveness rather than compactness. The problem is that it's impossible to measure the former objectively, compared to 32 vs. 33 character comparisons. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/