http://qs321.pair.com?node_id=1212844


in reply to Re^7: Curious about Perl's strengths in 2018
in thread Curious about Perl's strengths in 2018

I don't quite understand the notion that Python is "institution-centric". It lacks some things that Perl has but I see users having actual enthusiasm for it far more frequently than for, say, Java. There's way less boilerplate and strict control. "Private" methods, for example, are just marked with _ or __ in front as a mere suggestion not to use them outside of the class.

  • Comment on Re^8: Curious about Perl's strengths in 2018

Replies are listed 'Best First'.
Re^9: Curious about Perl's strengths in 2018
by karlgoethebier (Abbot) on Apr 14, 2018 at 14:54 UTC
    "I don't quite understand the notion that Python is "institution-centric"..."

    That's quite simple: It is "easier" to teach - better to handle for all the dumb assignments and Powerpoint slides and boring/annoying examinations in "institutions". It doesn't have this anarchical and noncompliant TIMTOWTDI.

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      The "anarchic and non-compliant" side of Perl can be a big strength for the individual hacker, but it also can be a big weakness when it comes to Perl being used in a bigger team as you need to explicitly agree on how to do things when with Python or Java there is simply one obvious way.

      I belive it is much harder to build a functioning team using Perl and I also believe this is one of the major reasons why Python is taking over in fields like data science.

        can be a big weakness when it comes to Perl being used in a bigger team as you need to explicitly agree on how to do things when with Python or Java there is simply one obvious way
        Agreed, with caveats about there being "simply one obvious way" in Python, as detailed below. It seems you and I are one of the "many" mentioned in John Wang's claim that "TIMTOWTDI is often cited as a strength but, taken to an extreme, it is also seen as a weakness by many".

        I much prefer the Enlightened Perl Organisation alternative TIMTOWTDIBSCINABTE, pronounced "Tim Toady Bicarbonate":

        There's more than one way to do it, but sometimes consistency is not a bad thing either

        Python's TOOWTDI ("There should be one -- and preferably only one -- obvious way to do it") notwithstanding, I discovered that, in practice, Python sometimes provides more ways to do it than Perl!

        As analysed in The golf course looks great, my swing feels good, I like my chances (Part VI), when considering how to create a "Dear John" string in each of the four languages (Perl, Python, Ruby, PHP) I could only see one obvious way to do it in Perl namely:

        "Dear $name"
        while in Python I found three:
        "Dear %s" % expr # Python % printf-like operator "Dear {0}".format(expr) # Python format string method "Dear "+`expr` # Python backticks (TIMTOWTDI)

        And from the classic 99 bottles of beer golf, when changing between "Take one down and pass it around" and "Go to the store and buy some more" - shortening the two strings above to "Take" and "Go to" for clarity - let's consider the many and varied ways of doing this in Python (TIMTOWTDI):

        "Take"if n else"Go to" (n>0)*"Take"or"Go to" ["Go to","Take"][n>0] ("Go to","Take")[n>0] n and"Take"or"Go to" "GToa kteo"[n>0::2] # "Slice and Dice" wins this golf!
        Admittedly, the winning Python slice and dice golf solution can hardly be described as obvious. :) As you can see, playing golf in Python is fun because there is more than one way to do it!

        Curiously, code golf is more popular in Python than Perl nowadays. See The golf course looks great, my swing feels good, I like my chances (Part IV) for evidence.

      I don't know how much "there is only one way to do it" realistically applies to Python, especially beyond the core language. In using pandas for example there may be a variety of ways to do the same thing.

Re^9: Curious about Perl's strengths in 2018
by Your Mother (Archbishop) on Apr 14, 2018 at 06:36 UTC
    "Private" methods, for example, are just marked with _ or __ in front as a mere suggestion…

    That's actually a "borrow word." :P

    You're quite right, nearly no one is enthusiastic about Java. Perl has "won" happiest users surveys and non-scientific google mining a couple of times.

    …as a medium of expression, you could do a lot better. Of all the great programmers I can think of, I know of only one who would voluntarily program in Java. And of all the great programmers I can think of who don't work for Sun, on Java, I know of zero.Great Hackers

    Plenty more gems in that including props for Perl and Python.

      For systems programming purposes, if C or C++ can be avoided and no other JVM language were available or anything like that, I would use Java without many reservations. C is relatively tedious. C++ has a Byzantine standard. Java is at least GC'd, which can be tolerated in some situations (though I suspect much of the sluggishness of Android with respect to iPrison platforms is due to the use of Java rather than Objective-C, which appears to be a much saner "C with objects" than C++ from what I know). Plus Java 8 did a lot to undo the excessive verbosity of previous iterations of the language.