Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: OT: Ruby On Rails - your thoughts?

by perrin (Chancellor)
on Nov 17, 2005 at 04:56 UTC ( [id://509288]=note: print w/replies, xml ) Need Help??


in reply to OT: Ruby On Rails - your thoughts?

I've been puzzled by the hype too, and have written about it a little on use.perl.org. Pretty much all of Ruby on Rails has been available in perl since before Rails became public, albeit not in such a well-documented and heavilly promoted form.

My current theory is that most of the cheerleaders are people who have never seen a high-level (scripting) language before. They are probably coming from using nothing but Java for years, and can't believe how much simpler the code is. The prejudice against Perl as a serious development language may have kept them away from from it, so they needed something new without Perl's reputation for unreadability to get them interested.

The tone of the articles can get pretty irritating though. For example, many of the authors are taking pot shots at Perl for having unreadable syntax, while lauding Ruby. Ruby looks like a slightly crazier syntax than Perl to me. I'm surprised more of the Java guys didn't get behind some kind of Python framework instead. Go figure.

UPDATE: Speak of the devil.

Replies are listed 'Best First'.
Re^2: OT: Ruby On Rails - your thoughts?
by tilly (Archbishop) on Nov 17, 2005 at 17:27 UTC
    Ruby looks like a slightly crazier syntax than Perl to me.

    Having used Ruby a bit and Perl a lot, I definitely prefer Ruby's syntax. It has a lot of the same shortcuts that Perl does, but is significantly more regular. With better defaults. And I find that as I go to more complex conceptual code, Perl is far more likely to get ugly on me.

    As a random (unfair) example. Suppose that I want to do a sort on an array of arrays based on the contents of the first column. In Ruby that's array = array.sort; In Perl that's @array = sort {$a->[0] cmp $b->[0]} @array; Suppose that I want to do a lexicographic sort (first column, then second, then...) In Ruby that's the default. In Perl that turns into truly ugly code.

    That is not an isolated example. Suppose that I have a hash of hashes and I want the keys of one of the subhashes. In Perl that's keys %{$hash_of_hashes{$foo}} while in Ruby that's hash_of_hashes[foo].keys. Which would you prefer to figure out in a hurry?

    This is not to say that there aren't warts to Ruby's syntax. For a start, I loathe optional semicolons. Secondly, I strongly dislike the lack of a variable declaration, meaning that there is no easy equivalent of strict available. Thirdly the Ruby philosophy of, "Oh, add every alias someone might expect for this" has a conceptual cost when reading someone else's code.

    But I still prefer it to Perl's. Significantly.

      That's reassuring to hear, actually. What I like about the recent success of Ruby is that it seems like a language which most Perl programmers would be pretty happy to work with, if it continues to grow. It's open source, unlike Microsoft's offerings, and higher level than Java.
      That's exactly what I think. In fact, I think one of the biggest adavantages Rails has over Maypole & similar frameworks in Perl is that it's written in Ruby :-)

      Yes, ruby is slower and the main developers have a tendency to choose "right" and "nice" over "simple" and "fast", but I'm very impressed with how the whole Rails system holds together as a logical, intuitive whole whithout making it look overly complex and longwinded (yes, Java, I'm looking at you)

      Having used Ruby a bit and Perl a lot, I definitely prefer Ruby's syntax. It has a lot of the same shortcuts that Perl does, but is significantly more regular. With better defaults. And I find that as I go to more complex conceptual code, Perl is far more likely to get ugly on me.

      As the AOL folk would say - me too !

      I loathe optional semicolons

      I love 'em. The less I have to type the better :-)

      Secondly, I strongly dislike the lack of a variable declaration, meaning that there is no easy equivalent of strict available.

      Curiously enough I've never found this a problem. I thought I would when I first read the Pickaxe book - before I did any coding. However I've never found it a problem in real life. My guess is that my test suites catch these mistakes early enough for it never to be a problem.

      Thirdly the Ruby philosophy of, "Oh, add every alias someone might expect for this" has a conceptual cost when reading someone else's code.

      I agree this is a pain, but I think enough people are pushing back against this idea now that it's a problem the community will fix.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://509288]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-25 22:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found