Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Perl Vs Ruby

by rovf (Priest)
on Nov 26, 2008 at 12:04 UTC ( #726081=note: print w/ replies, xml ) Need Help??


in reply to Perl Vs Ruby

Having done projects in both languages, I don't think you will find a clear advantage in one or the other when it comes to power of expressiveness. As it was already said, it is a big matter of taste.

For instance, I like very much with Ruby that Arrays and Hashes can be dealt directly instead of going via references, and that classes are "first class values". At the moment, an advantage of Ruby (depending on your application) might be that there is also a Java implementation of Ruby available (JRuby), which makes it easy to interface to Java classes.

On the other hand, I don't like some aspect of scoping rules in Ruby.

For both languages, I found the community very friendly, so it is comfortable for a beginner.

For people not knowing either language, I have the impression that Perl is easy to lear, while Ruby is very easy to learn. I got this impression from talking to various people who actually started with one or the other languages, plus my own impression. If you find the time, implement some small task in both languages and decide which you like better.

-- 
Ronald Fischer <ynnor@mm.st>


Comment on Re: Perl Vs Ruby
Re^2: Perl Vs Ruby
by JavaFan (Canon) on Nov 26, 2008 at 12:45 UTC
    For people not knowing either language, I have the impression that Perl is easy to lear, while Ruby is very easy to learn.

    I don't know about Ruby, but I disagree that Perl is easy to learn. Perl has tons and tons of features, quirks, special cases, and its own lexicon of idioms. On top of that, many simple tasks can be done in a diverse set of ways. In my experience as a teacher of both Perl and non-Perl languages, that makes Perl hard to learn. Many languages can be taught in a 3 or 4 day course. If I give a 5 day Perl course, I feel I've barely scratched the language.

    Now mind you, I don't think that a language that's hard to learn makes it worse. It's easy to learn how to handle a wheelbarrow, and it's a lot harder to learn to drive an 18 wheeler truck. But that doesn't mean the wheelbarrow is better at hauling.

      I don't know about Ruby, but I disagree that Perl is easy to learn. Perl has tons and tons of features, quirks, special cases, and its own lexicon of idioms.

      Maybe I should have been more precise here. I want to say: It is easy to get quickly to a point where you can write useful programs. Of course by then you know only a small subset. For instance, I wrote my first useful Perl program after having read about 3-4 hours the introduction in the Camel book. Before that, I wrote programs in C++, C, Tcl, ksh, Pascal and some other languages. I found that with Perl I became productive quickly.

      With Ruby, I found it somewhat faster to "go productive" and the language seems to me easier for beginners. I was teaching an absolute beginner Ruby as the first programming languages, and after maybe 10 hours in total, she was using it to write a 50+ line program which actually solved a concrete task (not a toy problem).

      In this respect, both Perl and Ruby are easy to start with, I think. But any language with a lot of features take time to learn. Even languages with a simple syntax, like Java or Lisp, do. With those languages, the "experience" needed to master them is in understanding the libraries, respectively the functions.

      May I ask you which languages you consider as simple to learn?

      -- 
      Ronald Fischer <ynnor@mm.st>
        > May I ask you which languages you consider as simple to learn?

        IMHO, Javascript, very reduced but effective! (please note, I don't mean DOM!).

        Many people instantly can write JS Code.

        Unfortunately JS has some fundamental design flows, hindering to go further towards a all purpose language!

        1. "for in" operates on herited properties, without any possibility to add elements to prototypes which are flaged as not enumerable.
        2. prototypical inheritance is a very unusual concept (but simple)
        3. Packaging is not easy to realise.

        IMHO JS will replace VBS and Python as "built in scripting language" for applications.

        Cheers Rolf

        UPDATE: To avoid misunderstandings, JS is for sure no all-purpose language, but easy for beginners!

        May I ask you which languages you consider as simple to learn?
        I'm not sure if there's any general purpose language that's both useful (as in, allowing one to program in an efficient manner) and simple to learn.

        But to name one thing that makes a language easier to learn to program in than Perl is what I call "lack of distraction". Perl syntax is rich and full, but because of that, it offers a lot of distraction - it's hard to introduce a new concept without having to explain new pieces of syntax. For that reason, I claim that C, Java, Python, LISP, Pascal and Haskell are all easier to learn than Perl. Of course, if someone already has a lot of experience in procedurial languages (for instance C) it'll be easier to learn Perl than LISP or Haskell. But as a first language, the languages I mentioned are easier. You can reasonably quickly learn the syntax, and then when you teach more advance techniques, you no longer need to focus on syntax anymore.

      I think you and rovf are both right. Perl is extremely easy to dive into and use but terribly difficult to master. I wrote my first production code 2 weeks after picking up the Llama 10 years ago. 10 years later I still learn new things here at least weekly. This is part of Perl's charm for me. It's exactly as useful/difficult/easy/productive as you have the interest to make it. Its payment curve coincides with its learning curve.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (13)
As of 2014-10-23 06:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (124 votes), past polls