in reply to perl python compare

Why perl is better than Python?
It isn't. Python is a brilliant language, ideal not only for beginners, but for experts and wizards as well. Perl on the other hand is a write once, impossible to read bag of line noise. Which is why Perl wussies so much like CPAN - they'll never have to read, much less understand the alien code. Python syntax is very easy to read and understand, so Python programmers never have the need to use the dogma "don't reinvent the wheel" as an excuse to go back and improve code once written. That's why Python programs (and programmers) get better over time, while Perl is just a swamp of stagnation.

Replies are listed 'Best First'.
Re^2: perl python compare
by Tux (Canon) on Mar 28, 2011 at 14:51 UTC

    It is very easy to write illegible code in any language and Python is no exception to that rule.

    It is very easy to write incomprehensible code in any language and Python is no exception to that rule.

    It is very easy to write inefficient code in any language and Python is no exception to that rule.

    It is very easy to write unportable code in any language and Python is no exception to that rule.

    Perl is not holy, but neither is any other programming or scripting language. I'd even say there is no perfect language. Each language will serve its own public and audience. I've been confronted with problems with both languages in the past, and if you look though what you say is write-once code (and there are enough ways to make that readable fast if needed), I have found that fixing failures in perl is waaaaaaay easier than fixing problems in python. But of course YMMV.

    Perl is a brilliant language, ideal not only for beginners, but for experts and wizards as well. Python on the other hand is an ugly language that cannot be moulded into something beatiful because it thinks "There Is Only One Way To Do It" would be ideal for anyone (but me). Python syntax might be easy (easier) to read than Perl's syntax (for beginners that is), but that is by no means a guarantee that that syntax is better, more efficient or easier to maintain. As python only gives you one wheel, if that wheel doesn't work you're fucked, as there is no other wheel available. The only options in that case imho are 1. give up, 2. use perl. That is why python programs are left to die and perl programs keep evolving.

    Just my view on the matter. And no, I do not hate Python. There is a best tool for every problem. Quite often that is not Perl, but most often it is not Python.


    Enjoy, Have FUN! H.Merijn

      Adding to it, I would also say

      Python's whole idea of slowing down a programmer and restricting freedom at the expense of readability(Supposedly) is big turn off. If I want to move slow, I would never ever use a scripting language. Moving slowly I can achieve the same tasks with C/C++ lot more efficiently than in Python. Im onto scripting for the power and pace of development.

Re^2: perl python compare
by Anonymous Monk on Mar 29, 2011 at 03:23 UTC
    Your assumption that Python is some sort of a magical entity that when one touches it transforms a bad programmer into a genius is so childish.
      Your assumption that Python is some sort of a magical entity that when one touches it transforms a bad programmer into a genius is so childish.
      Oh, yeah, such a notion would be childish.

      It's of course not true. Programmers don't go from evil to good by just touching a language, no, sir! Instead, the choosen language is a function of the programmers alignment. Good programmers choose Python. Evil programmers choose Perl. There's a scale of good to evil languages: (good) Python - .Net - Java - C - Ruby - C++ - Intercal - PHP - Perl - Perl6 (evil). Look at the language of choice, and one can instantly see whether a programmer is good or evil. Python programmers are cheerful, care for the environment, help cross old ladies across the street, write maintainable programs, and have a good sense of humour (Python is named after Monty Python after all). Perl programmers are grumpy, steal candy from babies, don't care about the environment (just look at all the flying around the world to attent their navel staring so-called "conferences"), write unreadable programs, and wouldn't recognize an ironic post if beaten to death with it. But what would you expect from a language created by a man who is dull enough that he first had to read the dictionary cover to cover to find a name for the language. After trying out his wife's name, and then picking a name already taking by someone elses language. Evil language, evil programmers.

        Um... I'll clarify JavaFan's point by stating:

        Perl is not only an evil language. It's a Chaotic Evil language. Chaos in a language enables the user to do all sorts of the same tasks in (from the outside perspective) any random way possible with no structure or preset way. While Evil really is a function of a language that uses things like Sigils (too many punctuation marks definitely is a wicked thing) as it's hard for someone who doesn't speak "Pointy-Haired Boss" (aka. Power Point) (and coders intent on getting an MBA or going into Marketting) to read. Anything too complicated or compact is obfuscated, and therefore evil. Perl is, from the get-go, evil by design. All this 'Multiple ways to do it' mentality is like the spawn with daemons, where they torture small children by forking and aborting them. Oh the horror.

        C++ is really more of a Neutral Language. C is probably considered more of a Neutral Evil language. Both trend towards evil, because everyone is always trying to make it better by changing it into new improved languages that don't employ its clearly evil cream-filling, like pointers or the traditional K&R single letter variable names.

        Lawful Evil languages would be something like Cobol or Ada. They're evil because no one likes them, except academics, old corrupt corporations, and defense contractors, and we all know those guys are evil.

        C# is probably Chaotic Good, in that it's got the kitchen sink in it and stole a lot from Perl. PHP, likewise, because of the sigil thing, I suppose, though you can so so little with it, that it's more righteous.

        Java's a Lawful Good language in that you can't do much with it, but it sure looks nice.

        Python borrows a lot from Perl, but also insists on indentation, so it's probably Neutral Good.

        Erm... sorry. I'll go back to being a Chaotic Evil Programmer... now.

        > ... and wouldn't recognize an ironic post if beaten to death with it.

        OMG, does it mean you are even not a Java fan? 8-o

        Cheers Rolf

        And where the frack is Lisp?? Really hard to to take your post seriously without it.... ;-)

        Elda Taluta; Sarks Sark; Ark Arks

        Unless you are being sarcastic,At first you were childish, now you are trying to be foolish.

        Pulling Larry and his personal preferences is shameful.

        The scale you mentioned denotes the measure of verbosity at one end and terseness at the other. It shows what kind of programmers need verbosity and its help for their straight brains. And what kind of programmers need terseness and its power.

      Some people believe you don't have to program to write Python code; you can get by writing pseudocode which, somehow, magically works.

Re^2: perl python compare
by LanX (Saint) on Mar 28, 2011 at 20:51 UTC
    Honorable abbot of the monastery!

    Curiosity almost kills me ... why are you still using Perl? :)

    Cheers Rolf

      Penance.
        LOL! :)

        Look I'm not a fanboy and I have no problem to admit that Python's design decisions sometimes lead to brilliant idioms.

        But I think that unfortunately it's not possible to discuss those here in an unemotional way.

        Also whenever I take a closer look into Python I stumble upon rather strange restrictions. So I'd rather tend to use Ruby!

        Anyway it's never wrong to learn from the other side.

        Cheers Rolf