What's better about Ruby than Python?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brandon J. Van Every

    What's better about Ruby than Python?

    What's better about Ruby than Python? I'm sure there's something. What is
    it?

    This is not a troll. I'm language shopping and I want people's answers. I
    don't know beans about Ruby or have any preconceived ideas about it. I have
    noticed, however, that every programmer I talk to who's aware of Python is
    also talking about Ruby. So it seems that Ruby has the potential to compete
    with and displace Python. I'm curious on what basis it might do so.

    --
    Cheers, www.3DProgrammer.com
    Brandon Van Every Seattle, WA

    20% of the world is real.
    80% is gobbledygook we make up inside our own heads.

  • Raymond Hettinger

    #2
    Re: What's better about Ruby than Python?


    "Brandon J. Van Every" <vanevery@3DPro grammer.com> wrote in message
    news:bhpbc6$1pl pe$1@ID-203719.news.uni-berlin.de...[color=blue]
    > What's better about Ruby than Python? I'm sure there's something. What is
    > it?[/color]

    Code blocks, automatic properties, continuations,
    and excellent Japanese documentation ;-)


    Raymond Hettinge


    Comment

    • Graham Fawcett

      #3
      Re: What's better about Ruby than Python?

      Brandon J. Van Every wrote:
      [color=blue]
      >What's better about Ruby than Python? I'm sure there's something.
      >[/color]
      Of course there is.
      [color=blue]
      >What is
      >it?
      >
      >[/color]

      You're never going to get an answer to this question that satisfies you.
      Even if everyone chips in and describes their favourite features, those
      features may be worthless to you personally. So why bother asking?

      Try the languages out yourself, both of them; program a non-trivial
      application in both languages. See how each feels to you, and which
      better suits your development style.

      Determine which language has, in your opinion, better support via
      documentation and community.

      Then come back to the list and tell us which is the better language. ;-)
      [color=blue]
      >This is not a troll. I'm language shopping and I want people's answers. I
      >don't know beans about Ruby or have any preconceived ideas about it.
      >[/color]

      Exactly: so don't ask for others' ideas. Since you haven't used Ruby
      yet, their ideas will simply give you preconceived ideas. What you need
      are postconceived ideas; harder to gain, but infinitely more valuable.

      -- Graham



      Comment

      • Ville Vainio

        #4
        Re: What's better about Ruby than Python?

        "Brandon J. Van Every" <vanevery@3DPro grammer.com> wrote in message news:<bhpbc6$1p lpe$1@ID-203719.news.uni-berlin.de>...
        [color=blue]
        > This is not a troll. I'm language shopping and I want people's answers. I[/color]

        ...
        [color=blue]
        > also talking about Ruby. So it seems that Ruby has the potential to compete
        > with and displace Python. I'm curious on what basis it might do so.[/color]

        :-)

        Comment

        • Asun Friere

          #5
          Re: What's better about Ruby than Python?

          "Brandon J. Van Every" <vanevery@3DPro grammer.com> wrote in message news:<bhpbc6$1p lpe$1@ID-203719.news.uni-berlin.de>...[color=blue]
          > What's better about Ruby than Python? I'm sure there's something. What is
          > it?
          >
          > This is not a troll. I'm language shopping and I want people's answers.[/color]


          When I was language shopping python was up to version 1.5.2 (actually
          it was probably up to 1.6.1, but not on the system I was using), and
          there were a number of distinct advantages that I felt Ruby held over
          Python.

          First and foremost, everything in Ruby was (behaved like) an object.
          That is now true for Python also.

          Secondly you could subclass basic types, again, this is true for
          Python as well.

          Thirdly the regular expression syntax was Perl-like and built into the
          core of the language (althought unlike perl, of course, the syntax
          generated an object). In a way this is unaesthetic, certainly
          python's approach is much more consistent with the object oriented
          nature of the language. However, I use regexp so often, and still
          find the re module cumbersome in comparison to Perl's way of doing
          things, so imho this is still and advantage (ugly as it may be) that
          Ruby holds.

          Finally I was apprehensive about the 'signigicant whitespace' issue in
          Python, and thought that Ruby's approach was safer. I've definitely
          changed my mind on that one. Now all manner of obsceneties are heard
          to eminate from my corner of the room whenever I have to program in a
          language which requires me to explicitly delimit blocks @!$*&#!!

          Some folks also like the existence of code blocks and iterators in
          Ruby, (Well Python has its own kind of iterators now as well,) but
          that didn't concern me greatly.

          In the end two things persuaded me to go with Python. Firstly I work
          in a 'Perl shop' and I'm supposed to write Perl (which I sometimes
          do), my using Python was already considered using an "obscure
          language," Ruby would have been quite beyond the pale. More
          importantly, Ruby just did not have anywhere near the range of
          libraries that Python did. Specifically Ruby, at that time, did not
          have any sensible way of handling XML (ie no SAX or DOM libraries).

          In my opinion, most of the advantages Ruby had over Python seem to
          have disappeared as Python has developed.

          Comment

          • Asun Friere

            #6
            Re: What's better about Ruby than Python?

            Erik Max Francis <max@alcyone.co m> wrote in message news:<3F4040F8. 87901505@alcyon e.com>...[color=blue]
            > "Brandon J. Van Every" wrote:
            >[color=green]
            > > What's better about Ruby than Python? I'm sure there's something.
            > > What is
            > > it?[/color]
            >
            > Wouldn't it make much more sense to ask Ruby people this, rather than
            > Python people?[/color]

            Maybe he can't speak Japanese?

            Comment

            • Brandon J. Van Every

              #7
              Re: What's better about Ruby than Python?

              Graham Fawcett wrote:[color=blue]
              > Brandon J. Van Every wrote:
              >[color=green]
              >> What's better about Ruby than Python?[/color]
              >
              > You're never going to get an answer to this question that satisfies
              > you. Even if everyone chips in and describes their favourite
              > features, those features may be worthless to you personally. So why
              > bother asking?[/color]

              You assume too much. My attitudes and criteria aren't yours. I ask because
              it's useful to me, not because it's useful to you.
              [color=blue]
              > Try the languages out yourself, both of them; program a non-trivial
              > application in both languages.[/color]

              I frankly don't have the time, and am not afraid to leverage other people's
              experiences to some degree.
              [color=blue]
              > Exactly: so don't ask for others' ideas.[/color]

              You have a profound difference of philosophy that I don't share. You seem
              to think other people's opinions are all or nothing.

              --
              Cheers, www.3DProgrammer.com
              Brandon Van Every Seattle, WA

              20% of the world is real.
              80% is gobbledygook we make up inside our own heads.

              Comment

              • Brandon J. Van Every

                #8
                Re: What's better about Ruby than Python?

                Asun Friere wrote:[color=blue]
                > Erik Max Francis <max@alcyone.co m> wrote in message
                > news:<3F4040F8. 87901505@alcyon e.com>...[color=green]
                >> "Brandon J. Van Every" wrote:
                >>[color=darkred]
                >>> What's better about Ruby than Python? I'm sure there's something.
                >>> What is
                >>> it?[/color]
                >>
                >> Wouldn't it make much more sense to ask Ruby people this, rather than
                >> Python people?[/color]
                >
                > Maybe he can't speak Japanese?[/color]

                I can't actually. Didn't know that Ruby was Nippocentric. And no, it
                wouldn't make "more sense" to ask the Ruby people this. They are going to
                give an answer that's biased from the Ruby perspective. For purposes of
                this post, I'm interested in the Python biased perspective.

                --
                Cheers, www.3DProgrammer.com
                Brandon Van Every Seattle, WA

                20% of the world is real.
                80% is gobbledygook we make up inside our own heads.

                Comment

                • Erik Max Francis

                  #9
                  Re: What's better about Ruby than Python?

                  "Brandon J. Van Every" wrote:
                  [color=blue]
                  > I frankly don't have the time, and am not afraid to leverage other
                  > people's
                  > experiences to some degree.[/color]

                  But surely in the time you've been considering the use of Python --
                  particularly now, since you claim to have to decided to use it as one of
                  your main development languages -- you could have taken a few hours or
                  so it would require to read and really absorb the tutorial (much less,
                  of course, if you're already a competent programmer, as you claim to
                  be)? You've certainly spent a great deal more than a few hours since
                  you first started posting your questions here, which was more than two
                  years ago (first coherent Python-related questions appeared in 2001
                  April, according to Google Groups).

                  --
                  Erik Max Francis && max@alcyone.com && http://www.alcyone.com/max/
                  __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
                  / \ 'Tis man's to fight, but Heaven's to give success.
                  \__/ Homer

                  Comment

                  • Sean 'Shaleh' Perry

                    #10
                    Re: What's better about Ruby than Python?

                    > > Try the languages out yourself, both of them; program a non-trivial[color=blue][color=green]
                    > > application in both languages.[/color]
                    >
                    > I frankly don't have the time, and am not afraid to leverage other people's
                    > experiences to some degree.
                    >[color=green]
                    > > Exactly: so don't ask for others' ideas.[/color]
                    >
                    > You have a profound difference of philosophy that I don't share. You seem
                    > to think other people's opinions are all or nothing.
                    >[/color]

                    these two statements are the crux of the problem.

                    If you joined a Chevy car mailing list and asked "what is better about Ford
                    than Chevy?" would you expect to hear intelligent, insightful responses?
                    Perhaps you would receive good answers, perhaps not. But if you never
                    actually looked at a Ford how would you know?

                    You see, by asking here you have people who have already decided against Ruby
                    for whatever reason. All we can give you is our reasons for not choosing it.
                    For balance you would HAVE to ask the Ruby people why they chose it over
                    something like Python.

                    Stating "well I just don't have time and would like others to decide for me"
                    just won't get you very far. Might as well being asking the group to finish
                    your homework assignments.

                    BTW, my reason, like many here is Ruby looks like Perl and I prefer Python's
                    syntax and design approach. Not a very scientific reason, about the same as
                    saying "well, I like blue ones more than red ones".



                    Comment

                    • Andrew Dalke

                      #11
                      Re: What's better about Ruby than Python?

                      Brandon J. Van Every:[color=blue]
                      > I have
                      > noticed, however, that every programmer I talk to who's aware of Python is
                      > also talking about Ruby. So it seems that Ruby has the potential to[/color]
                      compete[color=blue]
                      > with and displace Python. I'm curious on what basis it might do so.[/color]

                      Your logic is specious and your observations biased.

                      Perhaps the programmers "aware of Python" that you know are
                      more interested in comparing different languages, so know more
                      about languages in general?

                      How many Ruby programmers (per capita) do you know talking about
                      Python? Perhaps Python "has the potential to ...display Ruby"

                      How many Python-aware programmers do you know who also talk
                      about Java? Also talk about C#? About C++? About BASIC?

                      I don't know the programmers you sample from. but looking at c.l.py
                      since the start of the year, I can give you some numbers about other
                      languages mentioned. (From Google 'groups' search, numbers are
                      approximate.)

                      java group:comp.lang .python from Jan 1, 2003 to today. 1,680
                      perl group:comp.lang .python from Jan 1, 2003 to today. 1,550
                      tcl group:comp.lang .python from Jan 1, 2003 to today. 470
                      pascal group:comp.lang .python from Jan 1, 2003 to today. 295
                      ruby group:comp.lang .python from Jan 1, 2003 to today. 279
                      haskell group:comp.lang .python from Jan 1, 2003 to today. 155
                      eiffel group:comp.lang .python from Jan 1, 2003 to today. 99
                      rexx group:comp.lang .python from Jan 1, 2003 to today. 99
                      awk group:comp.lang .python from Jan 1, 2003 to today 58
                      ocaml group:comp.lang .python from Jan 1, 2003 to today. 26

                      Based on your logic, you should try pascal or tcl instead of ruby.
                      Though you really should be using perl or Java.

                      Of course, percent change is a better metric for up-and-coming,
                      so here's numbers for all of 2002. To get estimated 2003 numbers I
                      multiplied the above by 12/8, which means I'm a little on the low side
                      since August is only half-way through.

                      2002 2003 change
                      est. %
                      Java 2710 2520 - 7
                      perl 2580 2325 -10
                      tcl 922 705 -23
                      pascal 396 442 +12
                      ruby 542 418 -22
                      haskell 107 232 +117
                      eiffel 65 148 +128
                      rexx 95 148 + 56
                      awk 93 87 - 6
                      ocaml 60 39 - 35

                      Again, you looks like you should use Pascal. Or maybe haskell,
                      which was talked about a lot more this year already than all of
                      last year! (I keep meaning to learn some of it.)

                      So I suspect despite your statement about having no preconceived
                      ideas about Ruby that you do have some, which sensitises you
                      to discussions which mention it.

                      BTW, ruby's numbers on c.l.py for
                      2003 446 (I used 12/7.5 for a slightly better estimate)
                      2002 542
                      2001 487
                      2000 291
                      1999 162
                      1998 4

                      And Haskell's
                      2003 248 (ditto on 7.5)
                      2002 107
                      2001 282
                      2000 251
                      1999 63
                      1998 7

                      Given how many more people use Ruby than Haskell and how much
                      Ruby is mentioned as an alternative to the big 3 of Perl, Python,
                      and Tcl, it kinda makes you wonder if we aren't just a bunch of
                      programming language wonks in this group. :) If so, it would again
                      mean you aren't critical enough of your own beliefs and conclusions.

                      Andrew
                      dalke@dalkescie ntific.com


                      Comment

                      • John J. Lee

                        #12
                        Re: What's better about Ruby than Python?

                        "Michael Peuser" <mpeuser@web.de > writes:
                        [...][color=blue]
                        > I don't know much about Ruby but I did some substantial programming in
                        > Python and Perl. I should now consider side issues more important than
                        > language features itself:
                        >
                        > - How fast does the code run
                        > - Is there an acceptable IDE (best: GUI/IDE RAD-Framework)
                        > - Is there a flexible and fast GUI Toolkit
                        > -Can you access OpenGL
                        > - Which platforms are supported
                        > - How easy is multimedia (Sound/Movie in- and output)
                        > - How can you deploy your program
                        > - How large is a self contained EXE file
                        > - Is there mathematical support (array arithmetic, statistical functions,
                        > plotting)
                        > - Is there documentation
                        > - Are there books[/color]

                        AFAIK, none of these are distinguishing features between Python and
                        Perl.

                        The really major differences are: Perl has tons of library code
                        (though Python has lots) and Perl has a pile of stuff you have to
                        learn that brings no significant benefits. It'd be great to see more
                        research on the impact of the nonsense-overhead that comes with Perl
                        (and is absent from Python).


                        John

                        Comment

                        • Roberto Amorim

                          #13
                          Re: What's better about Ruby than Python?

                          > 6. The way Ruby handles parameterless functions as if they were[color=blue]
                          > properties.[/color]

                          That's the thing I like most about Ruby. But I couldn't get past its
                          Perl-like syntax and the garbage collector (the latter when mixed with
                          embedding).

                          Anyway, since Ruby 1.8.0 is (finally) out, I'll try it again to see if it
                          can be a viable alternative to Python (at least on some areas), but I doubt
                          it. Python, as a multiparadigm language, is quite unique on its approach,
                          and it seems much more fit to large projects than Ruby.

                          Regards,

                          Roberto




                          Comment

                          • Michael Peuser

                            #14
                            Re: What's better about Ruby than Python?


                            "John J. Lee" <jjl@pobox.co m> schrieb im Newsbeitrag
                            news:87ekzj6pbz .fsf@pobox.com. ..[color=blue]
                            > "Michael Peuser" <mpeuser@web.de > writes:
                            > [...][color=green]
                            > > I don't know much about Ruby but I did some substantial programming in
                            > > Python and Perl. I should now consider side issues more important than
                            > > language features itself:
                            > >
                            > > - How fast does the code run
                            > > - Is there an acceptable IDE (best: GUI/IDE RAD-Framework)
                            > > - Is there a flexible and fast GUI Toolkit
                            > > -Can you access OpenGL
                            > > - Which platforms are supported
                            > > - How easy is multimedia (Sound/Movie in- and output)
                            > > - How can you deploy your program
                            > > - How large is a self contained EXE file
                            > > - Is there mathematical support (array arithmetic, statistical[/color][/color]
                            functions,[color=blue][color=green]
                            > > plotting)
                            > > - Is there documentation
                            > > - Are there books[/color]
                            >
                            > AFAIK, none of these are distinguishing features between Python and
                            > Perl.
                            >[/color]
                            I absolutly disagree! We are (probably) not talking about the academic
                            merits of the languages, but of what you can do with them with reasonable
                            effort.

                            Those "side issues" I mentioned above (and some more, and some of them not
                            relevant for everyone) have - this is my experience - influenced my
                            productivity more than everything else.
                            Most of the things we do with - especially so called script languages is
                            inetrfacing library packages. Thoug this is not a feature of the languge it
                            is most important how to do it, what pachages have already been bound etc
                            etc. Consider the permanent discussions about what GUI oder IDE to use. The
                            OpenSource situation is, well unclear. I have learning a lot about that
                            durung the last two weeks, and I would say: Well perhaps take eric3 and
                            PyQt. But in fact I have no experience with eric and I very little with Qt.

                            If all those would be in a state as VB with its Active-X support and quitre
                            acceptable application framework or - eben better - as compiled RealBasic on
                            Macintosh with its universal Quicktime interface, then I should say you
                            could discuss fines language matters. (One should mention Delphi as well.)

                            But this is not the case.
                            [color=blue]
                            > The really major differences are: Perl has tons of library code
                            > (though Python has lots) and Perl has a pile of stuff you have to
                            > learn that brings no significant benefits. It'd be great to see more
                            > research on the impact of the nonsense-overhead that comes with Perl
                            > (and is absent from Python).[/color]


                            Just amount of "library code" is not what matters. You cannot have found it
                            on my list ;-)
                            Perl is not much better than Python - I think I did not mention that
                            explicitly.


                            Kindly Michael P
                            [color=blue]
                            >
                            > John[/color]


                            Comment

                            • Alexander Schmolck

                              #15
                              Re: What's better about Ruby than Python?

                              "Brandon J. Van Every" <vanevery@3DPro grammer.com> writes:
                              [color=blue]
                              > What's better about Ruby than Python? I'm sure there's something. What is
                              > it?
                              >[/color]

                              Since I think this is a reasonable question and I haven't seen to many direct
                              answer I'll give it a shot.

                              I recall the following, roughly in order of importance (treat with caution,
                              it's some time that I looked at Ruby):

                              0. I it's possible to redefine classes at runtime without going bonkers
                              (instances automatically get updated to the new class definitions). This, I
                              think is by far python's greatest flaw, amongst other things it greatly
                              compromises its interactiveness , which is a key virtue. If someone can
                              explain to me how I'm wrong on this and python's behavior really is sane,
                              I'll be eternally grateful.

                              1. syntactic distinction between destructive and nondestructive methods
                              (list.sort! vs list.sort)

                              2. lightweight lambdas (blocks)

                              3. Generally more OOation (in the style of Smalltalk), if you think that's
                              good (doesn't make functional programming easier, for example).
                              The class hierachies are certainly cleaner and, thanks to 'modules' (viz.
                              mixins), have less duplication. In python, for example there is no
                              reasonable way to find out whether something is a Mapping, or a number and
                              classes that should be taxonmically connected aren't and thus reduplicate
                              code (or just miss random features; e.g. both `str` and `list` have methods
                              that the other one could do with; in ruby this is handled by the
                              Enumeration module)

                              5. continuations, should you so desire.

                              6. An interesting attempt at an OO case statement.

                              I should add that 1. and 2. are however inexcusably flawed, especially since
                              they are really just (badly) adapted from scheme and smalltalk, respectively:

                              irb(main):001:0 > [1,2].sort
                              [1, 2]
                              irb(main):002:0 > [1,2].sort!
                              [1, 2]
                              irb(main):003:0 > [1].sort
                              [1]
                              irb(main):004:0 > [1].sort!
                              nil
                              ^^^ !!!

                              irb(main):017:0 > x = 10
                              10
                              irb(main):018:0 > [1,2,3].reject {|x| x < 2}
                              [2, 3]
                              irb(main):019:0 > x
                              3

                              This together with some other symptoms (what the hell is the point of having
                              Array.assoc?) gives me the overall impression that Ruby is an uglified
                              smalltalk, hideously disguised as Perl for mainstream appeal with some random
                              scheme features on top crafted by someone who doesn't seem to have quite
                              understood either smalltalk or scheme. OTOH, smalltalk and scheme at least
                              aren't such bad languages to steal from (even badly) and Ruby has one
                              worthwhile feature over (standard) smalltalk, mixins (there is BTW, some
                              interesting work in the squeak community on 'traits').

                              'as

                              Comment

                              Working...