in reply to Honest question about Perl, Python and Ruby

I think, that Python and Ruby are good languages, but the first thing that I want to point out is that, if the language is more popular, doesn't mean, that it's better.

For example, php, Visual Basic and Delphi are the most popular languages, because they are easy to learn and use. PHP, however is mostly, if not only, suitable for web projects. You can use it for standalone programs, but, it's difficult. Visual Basic and Delphi are the languages made for nonprogrammers or beginners. They are inflexible. It's easy to do simple programs, using them, but, when your projects grow, they crumble under their weight and there is a lot of bad quality code. For example, to do a simple procedure of justifying a text in a Visual Basic, took me almost 3 pages of code, while in perl, I did it in about 15 lines of code (about a half of the screen), that was more readable than in Visual Basic. The code from Visual Basic, Delphi and, to some extent, from php is very difficult to almost impossible to reuse on other projects.

In comparison to other languages, Perl has an best regular expression power. Also, it has a difficult to learn, but the best unicode support. With Perl, you can easily build very complex data structures (nested arrays, code references, associate arrays (hashes), within arrays, within hashes etc.)

Python, is object based from the ground up, while Perl has a support for object oriented programs. I like the mandatory documentation that you have to do in Python code. You can embed documentation in Perl programs, but it's not mandatory. I want to learn Python mostly, because it has a support in Paint Shop Pro, GIMP and Blender, gedit, gnome, etc., so I can automate things in those environments. There is a disadvantage, though, that there is no compatibility from Python 2 branch to Python 3 branch. Python 3, is pretty much a new language in comparison to Python 2. The abundance of Python 2 programs will not run under Perl 3.

  • Comment on Re: Honest question about Perl, Python and Ruby

Replies are listed 'Best First'.
Re^2: Honest question about Perl, Python and Ruby
by eyepopslikeamosquito (Archbishop) on Feb 07, 2015 at 05:39 UTC

    Python, is object based from the ground up

    Are you thinking of Ruby? Quoting Matz from An Interview with the Creator of Ruby:

    Then I came across Python. It was an interpretive, object-oriented language. But I didn't feel like it was a "scripting" language. In addition, it was a hybrid language of procedural programming and object-oriented programming. I wanted a scripting language that was more powerful than Perl, and more object-oriented than Python.

    I like the mandatory documentation that you have to do in Python code.

    Are you referring to Docstrings? In any case, I can assure you that documentation is not mandatory in Python. Even if it were, is it good and useful documentation?

    BTW, you can easily make documentation of your Perl modules "mandatory" by adding a test that uses Test::Pod::Coverage. As you might expect, this only enforces documentation coverage, not that the documentation is well-written.

    The abundance of Python 2 programs will not run under Perl 3.

    I wouldn't hold that against Python because the abundance of Perl 5 programs won't run under Perl 3 either. :)

      I wouldn't hold that against Python because the abundance of Perl 5 programs won't run under Perl 3 either. :)

      And then what happened?

      Pretty much all perl written since 1994 will still run on perl today, python won't

      http://perl5.git.perl.org/perl.git/tags

      ... 21 years ago perl-5a2 1994-Oct-07 22 years ago perl-4.0.36 1993-Feb-05 23 years ago perl-4.0.00 1991-Mar-21 24 years ago perl-3.044 1991-Jan-12 25 years ago perl-3.000 1989-Oct-18 26 years ago perl-2.001 1988-Jun-28 26 years ago perl-2.0 1988-Jun-05 27 years ago perl-1.0 1987-Dec-18

      https://en.wikipedia.org/wiki/History_of_Python

      Python 1.0 - January 1994 Python 1.6 - September 5, 2000 Python 2.0 - October 16, 2000 Python 2.7 - July 3, 2010 Python 3.0 - December 3, 2008 Python 3.4 - March 16, 2014
      Yes, I ment a docstring. I have a shallow introduction to python, so I thought, it was mandatory, but I've meant it as a plus anyway, since it will probably enforce the developers to document their programs better, then in other languages.
      I wouldn't hold that against Python because the abundance of Perl 5 programs won't run under Perl 3 either. :)
      Not a fair comparison, since, I was talking about a backward compatibility, but you are talking about older language, supporting programs, developed for the newer syntax, unless, you were joking.

        Not a fair comparison, since, I was talking about a backward compatibility, but you are talking about older language, supporting programs, developed for the newer syntax, unless, you were joking.
        Sorry, I was joking and made a poor joke. All I was trying to indicate with my bad joke is that in:
        The abundance of Python 2 programs will not run under Perl 3
        you made a typo: Perl 3 Python 3.

        And yes, re Python 3 breaking compatibility with Python 2, I strongly agree with you.

Re^2: Honest question about Perl, Python and Ruby
by Anonymous Monk on Feb 07, 2015 at 13:33 UTC
    As far as an "in between" language - What do you all think about Tcl/Tk?

    My perception that it is not too heavyweight; A little different syntax { Uses fewer special characters / operators } But not as widely used.

Re^2: Honest question about Perl, Python and Ruby
by doom (Deacon) on Feb 11, 2015 at 20:01 UTC
    "... Perl has an best regular expression power. Also, it has a difficult to learn, but the best unicode support."

    I was just about to make that point. Python's regular unicode handling sounds like it's getting better, but they're regexps still don't deal with it very well. I'm not sure about Ruby, but some years back Matz went with an encoding agnostic approach... if I've got it right, encoding is an attribute of a string, which makes me wonder what happens if you concatenate two strings with different encodings, one unicode and one something else...

    (All of them, however, beat the current generation of Javascripts, which still use the completely obsolete UCS-2 internally...)