in reply to Can we clap the face of skeptics?

You really think that Perl5 needs more frameworks than it has? And that Ruby is easier to read? Those are very questionable statements.

Replies are listed 'Best First'.
Re^2: Can we clap the face of skeptics?
by Fletch (Bishop) on Apr 22, 2008 at 17:13 UTC

    An unqualified all Ruby is clearer is questionable, but I don't think saying that there is some Ruby which is easier to read than equivalent Perl is at all questionable.

    For instance (heh) given $instance->member( $new_value ) vs instance.member = new_value, the Ruby is more apparently an assignment. Similarly "smarter" instances for built-in classes make for more succinct code in places (array.sort_by { |x| x.abs } vs the equivalent Schwartzian transform).

    (Then again judging from the post there could be an English barrier here and "all Ruby" wasn't the claim they meant to make.)

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      Hmm. Eye of the beholder, I guess. To me, it looks like the Ruby code is trying to redefine the method instance.member() while the Perl code is perfectly clear.

      For the accessor example, you can make it obvious that the Perl is an assignment by giving the method an unambiguous name:

      $instance->set_member( $new_value );

      That takes care of any functional advantage the Ruby syntax might have; anything else is a matter of personal taste. (I won't suggest using an lvalue accessor because AIUI that's not as expressive as the Ruby, though it can provide identical syntax for simple cases.)

      As for the sorting example --

      use Sort::Key 'keysort'; # or ukeysort, for optimisation freaks @array = keysort { abs } @array;

      is not significantly more complicated than the Ruby.