Hi -- On Sat, 31 May 2008, Dave Bass wrote: > 7stud -- wrote: >> Ahh, but the governing principle in the Ruby community is to make a Ruby >> script look as much like a Perl script as possible--efficiency be >> damned. So who in their right mind would pass up a chance to use a >> hieroglyphic regex like: /\|/ in their code. That's art. > > Larry Wall (Perl supremo) has called this sort of thing LTS: leaning > toothpick syndrome. But Perl's syntax allows you to write a regexp as > m(\|), which is a bit clearer. Or you can use the quotemeta() function > to add a backslash for you. I always figured it's easiest just to learn the regex stuff and get it over with. As a result, I can read regexes fluently as long as they don't use /x or %r{} :-) > 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. 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. David -- Rails training from David A. Black and Ruby Power and Light: INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin See http://www.rubypal.com for details and updates!