Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-03-28 18:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found