How's ruby compare to it older brother python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hunn E. Balsiche

    How's ruby compare to it older brother python

    in term of its OO features, syntax consistencies, ease of use, and their
    development progress. I have not use python but heard about it quite often;
    and ruby, is it mature enough to be use for developing serious application,
    e.g web application as it has not many features in it yet.

    I've given up on Perl for its ugly syntax and it is not the easiest language
    to learn. How about PHP?

    Thanks


  • Michael

    #2
    Re: How's ruby compare to it older brother python

    [color=blue]
    >in term of its OO features, syntax consistencies, ease of use, and their
    >development progress. I have not use python but heard about it quite often;
    >and ruby, is it mature enough to be use for developing serious application,
    >e.g web application as it has not many features in it yet.
    >
    >I've given up on Perl for its ugly syntax and it is not the easiest language
    >to learn. How about PHP?
    >[/color]
    IMO Ruby is closer to Perl than Python as far as clearness of it's
    syntax. I really like Python better. PHP isn't as garbled as Perl but it
    isn't as flexible either and it's still not nearly as clean as Python.
    Of the four languages (Perl, Python, PHP, and Ruby) I find Python the
    easiest to work in. I use Python for command-line programming, web
    programming (mod_python), and GUI programming (wxPython and Pygame) and
    find it a good general purpose language.

    Comment

    • Peter Maas

      #3
      Re: How's ruby compare to it older brother python

      Hunn E. Balsiche wrote:[color=blue]
      > I've given up on Perl for its ugly syntax and it is not the easiest language
      > to learn. How about PHP?[/color]



      Mit freundlichen Gruessen,

      Peter Maas

      --
      -------------------------------------------------------------------
      Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
      Tel +49-241-93878-0 Fax +49-241-93878-20 eMail peter.maas@mplu sr.de
      -------------------------------------------------------------------

      Comment

      • Peter Maas

        #4
        Re: How's ruby compare to it older brother python

        Hunn E. Balsiche wrote:[color=blue]
        > I've given up on Perl for its ugly syntax and it is not the easiest language
        > to learn. How about PHP?[/color]

        I forgot http://dada.perl.it/shootout, which is great for performance
        comparisons. Source code of the tests can be viewed easily to get a
        feeling for the strengths and weaknesses of the syntax as well.

        Mit freundlichen Gruessen,

        Peter Maas

        --
        -------------------------------------------------------------------
        Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
        Tel +49-241-93878-0 Fax +49-241-93878-20 eMail peter.maas@mplu sr.de
        -------------------------------------------------------------------

        Comment

        • Leif B. Kristensen

          #5
          Re: How's ruby compare to it older brother python

          Hunn E. Balsiche wrote:
          [color=blue]
          > in term of its OO features, syntax consistencies, ease of use, and
          > their development progress. I have not use python but heard about it
          > quite often; and ruby, is it mature enough to be use for developing
          > serious application, e.g web application as it has not many features
          > in it yet.
          >
          > I've given up on Perl for its ugly syntax and it is not the easiest
          > language to learn. How about PHP?[/color]

          It really depends on what you'll want to do. PHP is a great language for
          getting dynamic HTML pages up and running quickly. Perl is great for
          its string-handling abilities. (On my Web pages, I actually call a Perl
          script from PHP precisely for this reason.)

          However, both PHP and Perl can be very unwieldy for large projects. I'm
          a newcomer to Python, but it seems to scale much better than the other
          P-languages.

          For a first tour of Python, I'll suggest that you read the excellent
          tutorial by the language's author, Guido van Rossum:

          The official home of the Python Programming Language


          regards,
          --
          Leif Biberg Kristensen

          Validare necesse est

          Comment

          • John Roth

            #6
            Re: How's ruby compare to it older brother python


            "Hunn E. Balsiche" <hunnebal@yahoo .com> wrote in message
            news:c6ich0$c5m ee$1@ID-205437.news.uni-berlin.de...[color=blue]
            > in term of its OO features, syntax consistencies, ease of use, and their
            > development progress. I have not use python but heard about it quite[/color]
            often;[color=blue]
            > and ruby, is it mature enough to be use for developing serious[/color]
            application,[color=blue]
            > e.g web application as it has not many features in it yet.[/color]

            As another poster has mentioned, Ruby is more closely related
            to Perl than to Python. While I don't use it, people I respect who
            have moved to Ruby say it has a couple of real killer features;
            in particular the way blocks and the pervasive use of the visitor
            pattern come together change the way one writes programs for
            the better.

            As far as syntax is concerned, there doesn't seem to be a
            huge amount of difference. Syntax is syntax, and every language
            has it's little pecularities.

            I haven't seen enough of it to make me want to learn it, but it's
            on my list of languages to play with sometime.

            John Roth
            [color=blue]
            > Thanks
            >
            >[/color]


            Comment

            • Bruno Desthuilliers

              #7
              Re: How's ruby compare to it older brother python

              Hunn E. Balsiche wrote:[color=blue]
              > in term of its OO features, syntax consistencies, ease of use, and their
              > development progress. I have not use python but heard about it quite often;
              > and ruby, is it mature enough to be use for developing serious application,
              > e.g web application as it has not many features in it yet.[/color]

              Syntax : both Ruby and Python are pretty clean, Ruby being IMHO more
              consistent and Python easier to grasp

              OO : Ruby is OO all the way, and pretty close to Smalltalk. Python is
              more a mix of procedural and OO with some functional stuff too.

              Web : Python may have a bit more existing solutions, and a real killer
              app (Zope). Now, AFAIK, Ruby has also some interesting stuff for web
              developpement.

              IMHO, both are really great languages. I really like the elegance of
              Ruby and the ease of use of Python. So try both and pick the one that
              fits you're brain !-)
              [color=blue]
              > I've given up on Perl for its ugly syntax and it is not the easiest language
              > to learn.[/color]

              No comment...
              [color=blue]
              > How about PHP?[/color]
              <troll>
              One of the dumbest 'scripting' language I've ever worked with, but still
              a good solution for web developpement when you have no better (read :
              Python or Ruby) choice.
              </troll>

              Bruno

              Comment

              • Cameron Laird

                #8
                Is Perl *that* good? (was: How's ruby compare to it older brother python)

                In article <iL3jc.232$Yc.2 330@news4.e.nsc .no>,
                Leif B. Kristensen <junkmail@solum slekt.org> wrote:

                Comment

                • Leif B. Kristensen

                  #9
                  Re: Is Perl *that* good? (was: How's ruby compare to it older brother python)

                  Cameron Laird rose and spake:
                  [color=blue]
                  > In article <iL3jc.232$Yc.2 330@news4.e.nsc .no>,
                  > Leif B. Kristensen <junkmail@solum slekt.org> wrote:
                  > .[color=green]
                  >>getting dynamic HTML pages up and running quickly. Perl is great for
                  >>its string-handling abilities. (On my Web pages, I actually call a
                  >>Perl script from PHP precisely for this reason.)[/color]
                  > .
                  > I hear this more often than I understand it. Perl certainly
                  > does support many string-oriented operations. What's a speci-
                  > fic example, though, of an action you feel more comfortable
                  > coding in external Perl? I suspect there's something I need
                  > to learn about PHP's deficiencies, or Perl's power.[/color]

                  I'm glad that you asked :-)

                  The routine is for a phonetic search in Norwegian 18th century names,
                  which can be spelled in an amazing number of different ways. As I found
                  that the Soundex algorithm was useless for Norwegian spellings, I
                  invented my own. It's not really an algorithm, but a series of
                  substitutions that reduces names to a kind of primitives. Thus, eg.
                  Berthe, Birthe, Bergitte, Bergit, Birgit, Børte, Berit, and Brit, which
                  actually are interchangeable spellings of the same name, are reduced to
                  BRT.

                  Here's a small sample:

                  $str =~ s/HN/N/g; # John --> JON
                  $str =~ s/TH/T/g; # Thor --> TOR
                  $str =~ s/CHI/KJ/g; # Torchild --> TORKJL
                  $str =~ s/CHE/KJ/g; # Michel --> MKJL
                  $str =~ s/KKE/KJ/g; # Mikkel --> MKJL
                  $str =~ s/KIEL/KJL/g; # Kield -> Kjeld ( --> KJL)
                  $str =~ s/CH/K/g; # Christen -> Kristen ( --> KRSTN)
                  $str =~ s/CA/KA/g; # Carl -> Karl ( --> KAL)
                  $str =~ s/RL/L/g; # Thorleif <=> Tollef <=> Tolf ( --> TOLF)

                  I use a Perl script to transform my genealogy data from a FoxPro
                  database to MySQL command scripts. Thanks to the excellent module
                  DBD::XBase by Jan Pazdziora, this is a quite simple task.

                  In theory, the web routine for phonetic searches might have been
                  implemented in PHP. The trouble with that is that I would have to
                  maintain both a PHP and a Perl version of the same routine. I find it
                  much easier to just copy and paste the whole mess (at present about 120
                  lines) between the encoding and the decoding routines in Perl, and run
                  an exec("perl norphon.pl $name") from PHP.

                  regards,
                  --
                  Leif Biberg Kristensen

                  Validare necesse est

                  Comment

                  • Cameron Laird

                    #10
                    Re: Is Perl *that* good? (was: How's ruby compare to it older brother python)

                    In article <knbjc.267$id.3 998@news2.e.nsc .no>,
                    Leif B. Kristensen <junkmail@solum slekt.org> wrote:

                    Comment

                    • Roy Smith

                      #11
                      Re: Is Perl *that* good? (was: How's ruby compare to it older brother python)

                      In article <108qhidjthjpdc 0@corp.supernew s.com>,
                      claird@lairds.c om (Cameron Laird) wrote:
                      [color=blue]
                      > In article <knbjc.267$id.3 998@news2.e.nsc .no>,
                      > Leif B. Kristensen <junkmail@solum slekt.org> wrote:
                      > .
                      > .
                      > .[color=green]
                      > >which can be spelled in an amazing number of different ways. As I found
                      > >that the Soundex algorithm was useless for Norwegian spellings, I
                      > >invented my own. It's not really an algorithm, but a series of
                      > >substitution s that reduces names to a kind of primitives. Thus, eg.[/color]
                      > .
                      > .
                      > .
                      > "Canonicalizati on" is one name in academic English for this transformation.[/color]

                      But is it the cannonical name?

                      Comment

                      • Phil Tomson

                        #12
                        Re: How's ruby compare to it older brother python

                        In article <108pvmgl0h7m3e a@news.supernew s.com>,
                        John Roth <newsgroups@jhr othjr.com> wrote:[color=blue]
                        >
                        >"Hunn E. Balsiche" <hunnebal@yahoo .com> wrote in message
                        >news:c6ich0$c5 mee$1@ID-205437.news.uni-berlin.de...[color=green]
                        >> in term of its OO features, syntax consistencies, ease of use, and their
                        >> development progress. I have not use python but heard about it quite[/color]
                        >often;[color=green]
                        >> and ruby, is it mature enough to be use for developing serious[/color]
                        >application,[color=green]
                        >> e.g web application as it has not many features in it yet.[/color]
                        >
                        >As another poster has mentioned, Ruby is more closely related
                        >to Perl than to Python. While I don't use it, people I respect who
                        >have moved to Ruby say it has a couple of real killer features;
                        >in particular the way blocks and the pervasive use of the visitor
                        >pattern come together change the way one writes programs for
                        >the better.
                        >
                        >As far as syntax is concerned, there doesn't seem to be a
                        >huge amount of difference. Syntax is syntax, and every language
                        >has it's little pecularities.[/color]

                        Well, there is one big difference syntactically: Python uses indentation
                        as syntax and Ruby doesn't. Personally I don't prefer Python's
                        'indentation-as-syntax' since it means that syntactically significant
                        pieces of my code are invisible and if the tab settings in my editor are
                        not the same as yours it can make it difficult to share code (or even
                        worse, it might look like everything is OK when we share code, but the
                        code which looks exactly the same to each of us, might not be depending
                        on how tabs are or are not expanded). It would also seem to be a pain for
                        cutting & pasting code as well.
                        However, some people really like Python's indentation-as-syntax, so YMMV.

                        Your best bet is to actually use each language for a small project
                        so that you spend about a day with each language. You'll find that while
                        on the surface both languages seem quite similar, at a deeper level they
                        each have a very different effect on how you think about and approach the
                        problem. Some people find that Ruby best fits with their brain and others find
                        Python a better fit. You won't know until you try.

                        Phil

                        Comment

                        • Cameron Laird

                          #13
                          Re: Is Perl *that* good? (was: How's ruby compare to it older brother python)

                          In article <knbjc.267$id.3 998@news2.e.nsc .no>,
                          Leif B. Kristensen <junkmail@solum slekt.org> wrote:

                          Comment

                          • Cameron Laird

                            #14
                            Re: How's ruby compare to it older brother python

                            In article <c6jg7404m@enew s4.newsguy.com> ,
                            Phil Tomson <ptkwt@aracnet. com> wrote:

                            Comment

                            • John Roth

                              #15
                              Re: How's ruby compare to it older brother python

                              "Phil Tomson" <ptkwt@aracnet. com> wrote in message
                              news:c6jg7404m@ enews4.newsguy. com...[color=blue]
                              > In article <108pvmgl0h7m3e a@news.supernew s.com>,
                              > John Roth <newsgroups@jhr othjr.com> wrote:[color=green]
                              > >
                              > >"Hunn E. Balsiche" <hunnebal@yahoo .com> wrote in message
                              > >news:c6ich0$c5 mee$1@ID-205437.news.uni-berlin.de...[color=darkred]
                              > >> in term of its OO features, syntax consistencies, ease of use, and[/color][/color][/color]
                              their[color=blue][color=green][color=darkred]
                              > >> development progress. I have not use python but heard about it quite[/color]
                              > >often;[color=darkred]
                              > >> and ruby, is it mature enough to be use for developing serious[/color]
                              > >application,[color=darkred]
                              > >> e.g web application as it has not many features in it yet.[/color]
                              > >
                              > >As another poster has mentioned, Ruby is more closely related
                              > >to Perl than to Python. While I don't use it, people I respect who
                              > >have moved to Ruby say it has a couple of real killer features;
                              > >in particular the way blocks and the pervasive use of the visitor
                              > >pattern come together change the way one writes programs for
                              > >the better.
                              > >
                              > >As far as syntax is concerned, there doesn't seem to be a
                              > >huge amount of difference. Syntax is syntax, and every language
                              > >has it's little pecularities.[/color]
                              >
                              > Well, there is one big difference syntactically: Python uses indentation
                              > as syntax and Ruby doesn't. Personally I don't prefer Python's
                              > 'indentation-as-syntax' since it means that syntactically significant
                              > pieces of my code are invisible and if the tab settings in my editor are
                              > not the same as yours it can make it difficult to share code (or even
                              > worse, it might look like everything is OK when we share code, but the
                              > code which looks exactly the same to each of us, might not be depending
                              > on how tabs are or are not expanded). It would also seem to be a pain for
                              > cutting & pasting code as well.[/color]

                              As I said in another post, indentation is the reason I learned
                              Python in the first place, but it's not the reason I stay with
                              the language. In fact, I've come to the very heretical view
                              that the indentation sensitivity is a language design mistake.
                              It should be the editor's job to handle that level of detail in
                              a manner that the developer finds workable.

                              One reason I think it's a language design mistake is that
                              it's not recursive. That is, it's not possible to shift from
                              expression level indentation back to statement level
                              indentation without major disruptions. This is needed for
                              embedded blocks.

                              I think Ruby has a reasonable middle ground here: its use of
                              'end' is fairly unobtrusive compared to, for example, C, C++,
                              C# or Java. Even so, I think that a reasonable programming
                              editor would get them out of my face while I was programming.

                              The tab issue is one of those relatively inconsequential things
                              that people seem to love to argue about: I'd rather be able to
                              tell the editor how I want the program formatted, and have done
                              with it.
                              [color=blue]
                              > Phil[/color]


                              Comment

                              Working...