Professional Web Applications Themes

Python vs. Ruby - Ruby

Can anyone give me a good reason why I would want to use Ruby over Python? Does Ruby has any inherent advantages over Python? The reason I ask is because I have written quite a bit of code in Python and am about to start a new project, where I can use either language. Any suggestions would be highly appreciated. Thanks. -Fred -- Shameless plug: [url]http://JobMarketIntelligence.com[/url] A database of high-tech firms at your fingertips....

  1. #1

    Default Python vs. Ruby

    Can anyone give me a good reason why I would want to use Ruby over Python?
    Does Ruby has any inherent advantages over Python?

    The reason I ask is because I have written quite a bit of code in Python and
    am about to start a new project, where I can use either language.

    Any suggestions would be highly appreciated. Thanks.

    -Fred

    --
    Shameless plug:
    [url]http://JobMarketIntelligence.com[/url]
    A database of high-tech firms at your fingertips.
    Fred Guest

  2. #2

    Default Re: Python vs. Ruby

    Looks like a shameless provocation again ;-)
    Nice try, Fred
    Gennady.

    ----- Original Message -----
    From: "Fred" <fredjobmarketintelligence.com>
    Newsgroups: comp.lang.ruby
    To: "ruby-talk ML" <ruby-talkruby-lang.org>
    Sent: Thursday, August 28, 2003 2:36 PM
    Subject: Python vs. Ruby

    > Can anyone give me a good reason why I would want to use Ruby over Python?
    > Does Ruby has any inherent advantages over Python?
    >
    > The reason I ask is because I have written quite a bit of code in Python
    and
    > am about to start a new project, where I can use either language.
    >
    > Any suggestions would be highly appreciated. Thanks.
    >
    > -Fred
    >
    > --
    > Shameless plug:
    > [url]http://JobMarketIntelligence.com[/url]
    > A database of high-tech firms at your fingertips.
    >
    >

    Gennady Guest

  3. #3

    Default Re: Python vs. Ruby

    On Fri, 29 Aug 2003 06:36:12 +0900
    Fred <fredjobmarketintelligence.com> wrote:
    > Can anyone give me a good reason why I would want to use Ruby over Python?
    > Does Ruby has any inherent advantages over Python?
    The advantages of Ruby over Python are difficult to put into words;
    simply, as others have said, the whole is greater than the sum of the
    parts. If you demand an "objective" reason, or list of features that
    Ruby has that XYZ language does not, you probably won't get one that
    satisfies you.
    > The reason I ask is because I have written quite a bit of code in Python and
    > am about to start a new project, where I can use either language.
    >
    > Any suggestions would be highly appreciated. Thanks.
    I suggest this: go use it for your project and see how you like it.
    It's really simple to learn, and it can certainly do everything any
    other language can, so you won't paint yourself into a corner there.

    Just try it and see. Maybe you'll like it, maybe you won't; the only
    real way to find out is to decide for yourself.

    --
    Ryan Pavlik <rpavmephle.com>

    "Hold up here, Cap'n Featherhat." - 8BT

    Ryan Pavlik Guest

  4. #4

    Default Re: Python vs. Ruby

    On Fri, 29 Aug 2003, Fred wrote:
    > Can anyone give me a good reason why I would want to use Ruby over Python?
    > Does Ruby has any inherent advantages over Python?
    >
    Please go to [url]http://www.ruby-talk.org[/url] and search for Python.

    Others, please don't put us through this again. :)

    Chad


    Chad Fowler Guest

  5. #5

    Default Re: Python vs. Ruby

    On Fri, Aug 29, 2003 at 06:51:34AM +0900, Chad Fowler wrote:
    > On Fri, 29 Aug 2003, Fred wrote:
    >
    > > Can anyone give me a good reason why I would want to use Ruby over Python?
    > > Does Ruby has any inherent advantages over Python?
    > >
    >
    > Please go to [url]http://www.ruby-talk.org[/url] and search for Python.
    >
    > Others, please don't put us through this again. :)
    But... but... but... it's friday!

    -Martin wonders if non-heise-readers hold their flamefests on fridays, too...:)

    Martin Weber Guest

  6. #6

    Default Re: Python vs. Ruby

    > : Can anyone give me a good reason why I would want to use Ruby over
    > Python?
    >
    > Ruby smells better than Python. Also, it has cuter girls.
    >
    > Python sometimes tastes better if you prepare it right.
    I hadn't noticed the odor thing. It does have a faintly floral aroma
    doesn't it.

    Of course it is no surprise that you can get more and cuter girls with
    Rubies than you can with Pythons.

    Scott


    Scott Thompson Guest

  7. #7

    Default Re: Python vs. Ruby

    Careful, boys,

    There are some girls listening in on this and watching every move.

    LOL

    No...I'm not Kent Starr. Just what's left behind since he passed on.

    Regards,

    Mary Dixon
    [url]http://rubyforge.org/projects/colorpr/[/url]

    On 8/28/03 8:56 PM, "Scott Thompson" <eascomac.com> wrote:
    >> : Can anyone give me a good reason why I would want to use Ruby over
    >> Python?
    >>
    >> Ruby smells better than Python. Also, it has cuter girls.
    >>
    >> Python sometimes tastes better if you prepare it right.
    >
    > I hadn't noticed the odor thing. It does have a faintly floral aroma
    > doesn't it.
    >
    > Of course it is no surprise that you can get more and cuter girls with
    > Rubies than you can with Pythons.
    >
    > Scott
    >
    >

    W. Kent Starr Guest

  8. #8

    Default Re: Python vs. Ruby

    W. Kent Starr wrote:
    > Careful, boys,
    >
    > There are some girls listening in on this and watching every move.
    >
    > LOL
    >
    > No...I'm not Kent Starr. Just what's left behind since he passed on.
    >
    > Regards,
    >
    > Mary Dixon
    > [url]http://rubyforge.org/projects/colorpr/[/url]
    Girl ... Pythons? That bite? Ouch! Careful, I'm holding a Ruby! Will chip
    the fangs...

    Ok, so I guess my question is mostly answered. Not much difference except
    for personal preferences and the like.

    I don't want to start an rwar -- really. Was looking for an honest,
    objective answer, that is all.

    -Fred

    --
    Shameless plug:
    [url]http://JobMarketIntelligence.com[/url]
    A database of high-tech firms at your fingertips.
    Fred Guest

  9. #9

    Default Re: Python vs. Ruby

    Fred wrote:
    > Ok, so I guess my question is mostly answered. Not much difference except
    > for personal preferences and the like.
    >
    > I don't want to start an rwar -- really. Was looking for an honest,
    > objective answer, that is all.

    Given the permathread nature of this topic, I've put some links here:

    [url]http://www.ruby-doc.org/RubyEyeForThePythonGuy.html[/url]

    James

    >
    > -Fred
    >



    jbritt@ruby-doc.org Guest

  10. #10

    Default Re: Python vs. Ruby

    In article <3F503BB7.7010606ruby-doc.org>,
    [email]jbrittruby-doc.org[/email] <jbrittruby-doc.org> wrote:
    >Fred wrote:
    >> Ok, so I guess my question is mostly answered. Not much difference except
    >> for personal preferences and the like.
    >>
    >> I don't want to start an rwar -- really. Was looking for an honest,
    >> objective answer, that is all.
    >
    >
    >Given the permathread nature of this topic, I've put some links here:
    >
    >[url]http://www.ruby-doc.org/RubyEyeForThePythonGuy.html[/url]
    >
    >James
    LoL ;-)

    Does this mean that Rubyists are better at interior decorating? :)

    Seriously, This link on your page:
    [url]http://onestepback.org/index.cgi/Tech/Ruby/PythonAndRuby.rdoc[/url]

    I found to be one of the most concise descriptions of the main difference
    between Python and Ruby.


    Phil
    Phil Tomson Guest

  11. #11

    Default Re: Python vs. Ruby

    Phil Tomson wrote:
    > In article <3F503BB7.7010606ruby-doc.org>,
    > [email]jbrittruby-doc.org[/email] <jbrittruby-doc.org> wrote:
    ...
    >>
    >>Given the permathread nature of this topic, I've put some links here:
    >>
    >>[url]http://www.ruby-doc.org/RubyEyeForThePythonGuy.html[/url]
    >>
    >>James
    >
    >
    > LoL ;-)
    >
    > Does this mean that Rubyists are better at interior decorating? :)
    Well, I happen to think that Rubyists just have better taste. Wouldn't
    surprise me if that went beyond mere language choice.

    >
    > Seriously, This link on your page:
    > [url]http://onestepback.org/index.cgi/Tech/Ruby/PythonAndRuby.rdoc[/url]
    >
    > I found to be one of the most concise descriptions of the main difference
    > between Python and Ruby.
    Glad to hear that. I've only limited experience with Python, so if
    anyone with real knowledge of both Ruby & Python can comment on the
    links, or offer others, it would be appreciated. You needn't do it on
    this list; E-mail if you like.


    James
    >
    >
    > Phil
    >
    >



    jbritt@ruby-doc.org Guest

  12. #12

    Default Re: Python vs. Ruby

    "jbrittruby-doc.org" <jbrittruby-doc.org> wrote in message news:<3F519252.3090408ruby-doc.org>...
    > Well, I happen to think that Rubyists just have better taste. Wouldn't
    > surprise me if that went beyond mere language choice.
    Even if you meant that as a joke, the statement is actually at
    the root of language wars. No sane people would argue tens of
    messages that pie is better than cake. People have finally understood
    the differences between tastes, regarding edible things (ok, some
    snobs may state that people who like caviar have better taste than
    those who don't, but those are not in the majority).

    But when it comes to languages, there are just people with better
    taste and people with worse taste. Language choice is often
    based on some kind of meta-science. You can *prove* that something
    can be expressed more compactly in Perl than in C++. Yet you can
    show that there has been many excellent libraries made with C++,
    that, when finished, are elegant to use and couldn't have been
    made as nicely with Perl. Then people also like to go into the
    fuzzier regions like "Python is easier to read than Ruby", stating
    this as a fact of course.

    Unless a language can be shown to be able to make a lot better
    abstractions without reducing readability or comprehensability
    (already a hard task to show objectively), then little can be said
    about what language is better. Take Python and Ruby comparisons,
    for example. These languages differ only in subtleties like
    indentation vs blocks, self vs , or Ruby's "pure OO" vs
    Python's "almost pure OO" (that many consider very pure),
    which bears little or no meaning in actual code. I've actually
    seen a lot less arguments between C++ and Ruby/Python, as I've
    seen between Ruby and Python. That alone goes to show that
    the lenghtiest arguments arise from the most insignificant details.

    I was quite humoured by this article:
    [url]http://www.cs.washington.edu/homes/kd/courses/pythonruby.pdf[/url]

    It said having to use abs(-5) instead of -5.abs is a "major problem
    with Python". And I'm afraid they were serious, even though that's
    not far from begin complete nonsense. They were not concerned with
    the syntactic difference between overloaded operator calls and normal
    function calls, for example. Or that some might actually prefer abs(x).
    Oh boy, would they enjoy Lisp or Scheme. For some reason, most of us
    don't.
    Hannu Kankaanpää Guest

  13. #13

    Default Re: Python vs. Ruby

    Hannu Kankaanpää wrote:
    > Even if you meant that as a joke, the statement is actually at
    > the root of language wars. No sane people would argue tens of
    > messages that pie is better than cake.
    You assume that programmers are sane.
    > But when it comes to languages, there are just people with better
    > taste and people with worse taste. Language choice is often
    > based on some kind of meta-science. You can *prove* that something
    > can be expressed more compactly in Perl than in C++.
    But you can't prove that "more compact" is "better."
    >
    > I was quite humoured by this article:
    > [url]http://www.cs.washington.edu/homes/kd/courses/pythonruby.pdf[/url]
    >
    I will read that.

    I am sure you will be humoured by many of the replies
    to your post also. :)

    Hal


    Hal Fulton Guest

  14. #14

    Default Re: Python vs. Ruby

    On Monday 01 Sep 2003 9:47 am, Hannu Kankaanpää wrote:
    > I was quite humoured by this article:
    > [url]http://www.cs.washington.edu/homes/kd/courses/pythonruby.pdf[/url]
    >
    > It said having to use abs(-5) instead of -5.abs is a "major problem
    > with Python". And I'm afraid they were serious, even though that's
    > not far from begin complete nonsense.
    They also seemed to be offended by being able to type

    print "Hello world"

    Though from their second alternative I guess they weren't aware that you can
    write

    STDOUT.print "Hello world"

    Though IMHO having to write STDOUT all the time would get tiresome very
    quickly (and "hello world".print just looks weird)

    So I'd say that Ruby has the right balance of purity and practicality.
    > They were not concerned with
    > the syntactic difference between overloaded operator calls and normal
    > function calls, for example. Or that some might actually prefer abs(x).
    > Oh boy, would they enjoy Lisp or Scheme. For some reason, most of us
    > don't.
    Best Regards

    Mark Sparshatt


    mark Guest

  15. #15

    Default Re: Python vs. Ruby

    mark wrote:
    >
    > On Monday 01 Sep 2003 9:47 am, Hannu Kankaanpää wrote:
    > > I was quite humoured by this article:
    > > [url]http://www.cs.washington.edu/homes/kd/courses/pythonruby.pdf[/url]
    > >
    > > It said having to use abs(-5) instead of -5.abs is a "major problem
    > > with Python". And I'm afraid they were serious, even though that's
    > > not far from begin complete nonsense.
    >
    > They also seemed to be offended by being able to type
    >
    > print "Hello world"
    >
    > Though from their second alternative I guess they weren't aware
    > that you can
    > write
    >
    > STDOUT.print "Hello world"
    >
    > Though IMHO having to write STDOUT all the time would get tiresome very
    > quickly (and "hello world".print just looks weird)
    >
    > So I'd say that Ruby has the right balance of purity and practicality.
    >
    > > They were not concerned with
    > > the syntactic difference between overloaded operator calls and normal
    > > function calls, for example. Or that some might actually prefer abs(x).
    > > Oh boy, would they enjoy Lisp or Scheme. For some reason, most of us
    > > don't.
    Regardless of their concluding paragraph, the body of the article still read
    more like an endorsement of Ruby.

    But, perhaps I'm biased... :-)

    Curt




    Curt Hibbs Guest

  16. #16

    Default Re: Python vs. Ruby

    mark wrote:
    > On Monday 01 Sep 2003 9:47 am, Hannu Kankaanpää wrote:
    >
    >>I was quite humoured by this article:
    >>[url]http://www.cs.washington.edu/homes/kd/courses/pythonruby.pdf[/url]
    >>
    >>It said having to use abs(-5) instead of -5.abs is a "major problem
    >>with Python". And I'm afraid they were serious, even though that's
    >>not far from begin complete nonsense.
    >
    >
    > They also seemed to be offended by being able to type
    >
    > print "Hello world"
    >
    > Though from their second alternative I guess they weren't aware that you can
    > write
    >
    > STDOUT.print "Hello world"
    >
    > Though IMHO having to write STDOUT all the time would get tiresome very
    > quickly (and "hello world".print just looks weird)
    >
    > So I'd say that Ruby has the right balance of purity and practicality.
    >
    >
    >>They were not concerned with
    >>the syntactic difference between overloaded operator calls and normal
    >>function calls, for example. Or that some might actually prefer abs(x).
    >>Oh boy, would they enjoy Lisp or Scheme. For some reason, most of us
    >>don't.
    I think the author was a little mistaken about Ruby though. You don't
    call methods of a numerical object to perform most math operations like
    sin and such. That's all provided by the Math module (unless things
    have changed since Dave and Andy's "Programming Ruby"). -5.abs is the
    only math-like method of a number, as far as I know.

    I didn't agree with the "Hello world" example either. I don't think
    it's a question of how you perform tasks with an object as much as which
    module's job is it to do what. OOP doesn't mean every object needs a
    method for everything that can possibly be done with itself.

    In my opinion, -5.abs seems right; -5 and 5 are the same, except one has
    the property of being negative and the other does not. It makes sense
    to me that -5 would know how to represent itself without it's negative
    property. The object holds the value 5, with a property that equates to
    "negative=true".

    Along that same line of thinking, sin(5) seems right too. sin(5) is NOT
    the same as 5, and I don't expect 5 to know how to the result of its
    sine function result. That's the job of a math module.

    The method print doesn't seem to me to belong, logically, to the string
    "Hello world", so I don't expect the string to know how to print itself.
    It does seem to me to belong as a method of $stdout, however.

    I remember back in the early 90's when I first dove into C++, there
    seemed to be this thought process regarding OOP that went something
    like: every object should be able to stand alone and interact rarely, if
    ever, with anything else because that would break the object's
    encapsulation. I got that feeling from several texts, and I thought it
    ludicrous at the time, and still do. As things have evolved, it seems
    common sense has stepped in to replace those purist theories, but that
    article really took me back to that time.

    Sean O'Dell

    Sean O'Dell Guest

  17. #17

    Default Theory of Encapsulation (was: Python vs. Ruby)


    On Sep 1, 2003, at 3:29 PM, Sean O'Dell wrote:
    > I remember back in the early 90's when I first dove into C++, there
    > seemed to be this thought process regarding OOP that went something
    > like: every object should be able to stand alone and interact rarely,
    > if ever, with anything else because that would break the object's
    > encapsulation. I got that feeling from several texts, and I thought
    > it ludicrous at the time, and still do. As things have evolved, it
    > seems common sense has stepped in to replace those purist theories,
    > but that article really took me back to that time.
    Your original interpretation of the idea of encapsulation is one that I
    find held by a lot of folks that are new to object-oriented programming
    as you no doubt were in the early 90's. The ideas may have been
    presented improperly, or you may have misinterpreted them, but the
    ideas are not ludicrous unless you take them to an illogical extreme.

    The idea is that every object should encapsulate a single idea, a
    cohesive concept, and should not have to look outside of itself to
    implement that concept. If it does, then it will have to expose
    implementation details of itself to others through it's public
    interface. Once you do that you have violated encapsulation.

    It is not the idea that objects should interact with other objects
    rarely. Obviously if that were true then you would have system that
    never did anything :-).

    Rather it's along the same lines as Einstein's "Make things as simple
    as possible but no simpler", the idea is that objects should interact
    with other objects as little as possible and certainly NOT as a means
    of implementing behavior that should be the province of the object
    itself.

    The other way I've heard it described is with the terms Coupling and
    Cohesion. With all due respect to Dirk Gently, Coupling refers to the
    interconnectedness of all things within your program. Cohesion refers
    to keeping related data, objects, behaviors, etc... together in tightly
    related groups. An ideal system will have have very low coupling,
    passing as few messages between objects as necessary to get the job
    done, and have very high Cohesion, with related data and behaviors
    collected into logical containers.

    As with most things, however, this is more an organizing principle than
    a hard and fast rule. There are a thousand things that, under any
    given set of cirstances, can call for coupling than one might like
    to have, or less cohesion. The concepts, however, are valuable to keep
    in mind.

    Scott

    Scott Thompson Guest

  18. #18

    Default Re: Theory of Encapsulation

    Scott Thompson wrote:
    >
    > On Sep 1, 2003, at 3:29 PM, Sean O'Dell wrote:
    >
    >> I remember back in the early 90's when I first dove into C++, there
    >> seemed to be this thought process regarding OOP that went something
    >> like: every object should be able to stand alone and interact rarely,
    >> if ever, with anything else because that would break the object's
    >> encapsulation. I got that feeling from several texts, and I thought
    >> it ludicrous at the time, and still do. As things have evolved, it
    >> seems common sense has stepped in to replace those purist theories,
    >> but that article really took me back to that time.
    >
    > Your original interpretation of the idea of encapsulation is one that I
    > find held by a lot of folks that are new to object-oriented programming
    > as you no doubt were in the early 90's. The ideas may have been
    > presented improperly, or you may have misinterpreted them, but the ideas
    > are not ludicrous unless you take them to an illogical extreme.
    Well, now, that's the big catch, isn't it? =)

    Developers are FAR more practical about encapsulation these days. =)

    Sean O'Dell

    Sean O'Dell Guest

  19. #19

    Default Re: Python vs. Ruby

    On 1 Sep 2003 01:36:28 -0700, [email]hanzspam.au[/email] (Hannu Kankaanpää)
    wrote:
    >I was quite humoured by this article:
    >[url]http://www.cs.washington.edu/homes/kd/courses/pythonruby.pdf[/url]

    Heh. It does wear its bias a little obviously, doesn't it?

    "Ruby supports Arrays and associative arrays (Hash). Python has Lists
    and Tuples which are the same as arrays." Er, yes, and Python has
    dictionaries, too, which are the same as associative arrays, so the
    apparent point in favour of Ruby is spurious...
    Tim Rowe Guest

  20. #20

    Default Re: Python vs. Ruby

    On Tue, 2 Sep 2003 04:21:02 +0900, "Curt Hibbs" <curthibbs.com>
    wrote:
    >Regardless of their concluding paragraph, the body of the article still read
    >more like an endorsement of Ruby.
    >
    >But, perhaps I'm biased... :-)
    No, I think the /article/ was biased :-)
    Tim Rowe Guest

Page 1 of 2 12 LastLast

Similar Threads

  1. ruby from python
    By Adriano Volpones in forum Ruby
    Replies: 0
    Last Post: October 20th, 09:53 AM
  2. Ruby Patriotism: Python+XML v. Ruby+YAML
    By why the lucky stiff in forum Ruby
    Replies: 5
    Last Post: October 10th, 01:15 PM
  3. Ruby vs Python?
    By Daniel Carrera in forum Ruby
    Replies: 8
    Last Post: September 17th, 04:32 PM
  4. OOP flavours - was Python vs. Ruby
    By Ryan Pavlik in forum Ruby
    Replies: 5
    Last Post: September 9th, 09:05 AM
  5. Replies: 1
    Last Post: August 23rd, 10:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139