Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I'm currently working in an office full of Perl junkies who have to use Python (actually Jython) because of the reasons you cited. It was a bit painful at first, but the language is fairly well documented and easy to learn.

One problem I have with it is the lack of CPAN. I think there's no underestimating its value. We are constantly running around trying to get modules or write our own. Python (especially Jython) hasn't reached the state yet where you can do just about anything, so frankly it's a pain to use.

Is the syntax cleaner? I have no idea. When I was learning Perl the sigils were only a little confusing. Now they come naturally, so I don't know. It just seems to me like grammatical inflection, no less natural than conjugating verbs. Initially with Perl you spend lots of time getting used to it. In Python, there's no up front cost, but a constant cost when you have to look up the first use (notice I didn't say declaration... there isn't a use strict mode that makes you declare them) of any variable you see.

The biggest problem I have with Python, though, is the attitude it has against messy syntax. I know that may seem weird, but I like the fact that have multiple options for doing the same thing. In talking to our more Python-oriented guys, that seems to directly offend them. To me, computer languages should be an attempt to map to human problems. Larry's 3rd State of the Onion was all about this concept. Trying to clean up the language to mask it may not be the most effecient use of our time.

On the other hand, take a look at the 1996 article Perl vs. Python by Tom Christiansen. It's a bit out-dated, but it makes good points. The most salient for my company's application (besides Java compatibility) being its intrinsic object-orientedness. Perl's object model is powerful and allows many good things, but it's not as easy to learn as Python's. You have to be very good at Perl to be able to use Perl objects. You can use objects in Python within 24 hours of starting to learn it.

All in all I miss Perl terribly and still use it in my personal projects, but so far Python isn't stealing my sheep, robbing my house, or giving me shooting pains up and down my spine, so we'll keep using it. It's certainly better than that Barbarian horde we tried to hire to work on this part of the application (sorry, inside joke).

MM

p.s. Want a laugh? Try to imagine a Python Golf Challenge!

Update: I knew I had a specific example of "cool" Python syntax that I did want to share:

if listElement in aList: ... do stuff ...

In Perl you gotta do this with grep (or something else like that). It's pretty.

And another thing, this book saved our lives on this project. It's very objective, doesn't get at all religious, and has a very informative feel to it. "If you want to do this in Perl, here it is in Python." It has an alphabetical list of functions and their equivalents. I can't recommend it higher. It does not seek to answer "which is better", it just recognizes that this problem exists and shows how to cope.


In reply to Re: Perl vs. Python: Looking at the Code by Maestro_007
in thread Perl vs. Python: Looking at the Code by mothra

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (6)
    As of 2019-10-14 22:34 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Notices?