Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Perl vs Python revisited

by perldigious (Priest)
on Jan 10, 2017 at 15:04 UTC ( [id://1179317]=note: print w/replies, xml ) Need Help??


in reply to Perl vs Python revisited

I really appreciated reading this and getting your opinion on the differences, especially given your particular situation. I'm still constantly perplexed by the common preference for Python over Perl and in many cases the even more caustic view that, "Perl is bad, you shouldn't use it," usually because of vague reasons being reiterated from some biased author at a trade magazine or blog. I've had several arguments with the VP I work under where that's his belief and he refuses to budge on it, which is made funnier by the fact that all the new automated metric tools he loves and raves about I wrote... in Perl. :-)

Not too long ago we were interviewing a potential new engineer, and part of that process involves taking them around and introducing them to a bunch of members in our little group here so each of us can give a quick overview of the increasingly random list of things we work on for the company. She had almost that exact response of, "Perl is bad, you shouldn't use it," and I was really surprised she said that after I told her I used it and motioned to a stack of Perl books on my desk. Good that she's willing to state her opinion, although obviously not particularly tactful about it in this case. When I asked why she felt that way, she said that's what her colleagues at her previous employer (Atmel) all more or less thought and told her. I gave a shoulder shrug, suggested not necessarily taking other peoples opinion at face value, and more or less said "a tool is a tool and as long as it gets the job done, great." I'm just glad my tool happens to be a Swiss Army Chainsaw. :-)

Almost everyone I work with codes in Python, lots of Rat Books around, but honestly most of them just dabble and do little quick hacks with it, only one of them uses it to the extent I use Perl at work (though he is admittedly a lot more knowledgeable on just about everything Computer Science than I am). He's not opposed to me using Perl anymore than I'm opposed to him using Python, we occasionally zing each other for fun, but I accept that he just likes Python and he accepts that I just like Perl. We even haphazardly try to help debug each others code from time to time.

What does miff me is the often smug and superior attitude of many that prefer Python. I shudder at the thought of having to learn Parseltongue in the future out of necessity to get a job with a Snake Cult. I just really like Perl, I'll use it over something else as long as I'm allowed.

Humor Tangent: My inner six year old was absolutely delighted to discover you are in fact at the time of posting, a French Friar. :-)

Just another Perl hooker - Yes, I'll do really dirty code, but I charge extra.

Replies are listed 'Best First'.
Re^2: Perl vs Python revisited
by stevieb (Canon) on Jan 15, 2017 at 14:41 UTC
    "I shudder at the thought of having to learn Parseltongue..."

    If you've been coding Perl for any length oftime and have a reasonable understanding of OO, Python is exceptionally easy to grasp, particularly in the case you mention that most of your peers use it for simple things. Here's a pretty decent intro.

    One problem with Python I've found at work, is sometimes people go way too crazy with significantly ridiculous levels of inheritance that oftentimes don't even have a proper hierarchy (think 10 levels with cross-pollution). I suppose that happens in Perl as well, I've just never seen it.

    I feel that it's handy to at least have some working knowledge of languages that are widespread, even if only for a single reason: porting a library or portion of code to Perl ;)

    For the Rasperry Pi work I've been doing lately, oftentimes I refer to existing Python code when I'm writing a new module for specific devices/sensors etc. I read the datasheet, harvest and/or write C code, the review the Python of known good existing libraries as a comparison to how I'm thinking I want my API to work. Python is king in the Pi world (well, C is really, but the majority just want it "easy" so they use RPi.GPIO), so understanding Python has made it a bit easier for me to help provide Perl users the same benefits that the Python kiddies already have.

      As a pure acolyte for the past ten years, when I finally took note of the need to have a good scripting language for my online business, and began writing perl spaghetti code to get simple jobs done - recently I had an epiphany.

      I was having difficulty with a Perl text parsing script that 'normally' works but was utterly recalcitrant at renaming some files.

      Now, please understand that I am not a programmer. Typically I hack scripts as templates to get them to work. And after enough time they normally always do. This script was an exception. Homegrown.

      I tried for about two hours oin Python to get it to work. No luck. Tried Ruby, and in a few minutes it was working fine. It was my one and only time I have ever written a Ruby script.

      I realized that I had a lot of programming to do in the future. I am planning on coming out of semi-retirement (assuming the economy improves) and overhaul my web sites, as well as creating a specialized library catalog for over half a million etexts.

      But at that fateful moment with Ruby I had a sudden enlightenment. I have dabbled with trying to learn a host of other languages. C is simply monstrous and needlessly repetitive for my needs - its Assmebler with labels.

      Java is someting I have come to hate. I have worked in multiple Java projects, only to find it pointlessly confusing and bloviated.

      There is something likable about Python, but its hopelessly cracked for me. Its main strength lies in what people have done for it (modules), rather than what it can do technically, at least as easily with Perl. Mind you I speak as a dabbler, and not a pro.

      Ruby showed me outright that i needed to spend as much time and effort as possible mastering Perl. Which I have been doing for the past two weeks. Relearning it from v5.10 basics. To me at least, Ruby is Perl Lite geared for OO. I have very little need for OO, which I see as needlessly complicating for non-production scripts.

      My point in this meandering gibberish is this: In the past few years Perl has arisen from the dead, and nobody noticed. But most importantly, unlike Ruby and Python which seem to have decent, if not strong neophyte communities, for Perl the only site with sufficient traffic to avoid continuous necroposting is here, Unfortunately this site can be a bit intimidating for new users.

      I spent the majority of last night looking for a simple forum to ask dumb questions on perl. Sorry but IRC and mailing lists are simply out for me. No way, no how. I also noticed the forums with the heaviest traffic seemed to be PHP. My experience with my web site and its support forum is that the majority of PHP users are not programmers. Hells bells, even apparently the majority of web site *designers* are not programmers.

      The average person does not understand what TIMTOWTDI(sp?) means and the utter personalization of styles that Perl allows, allowing one to write utterly obfuscated, to essentially GW BASIC code. I proudly use the GOTO statement, for example. I do not write my scripts for peer review. However when I do share code, Perl allows me to spiffy it up, and become more easily readable by non-programmers. Its syntax, when not using unnecessary shortcuts is actually quite readable. Even a few *years* later. Larry is after all a linguist....

      An humble suggestion would to create here amongst the giants, a *playground* where strict and warnings are left at the gates, and new folks are encouraged to play around with the code and grow with it, and even personalize it to their languages and cultures. Even a MyBB type subforum for those who find the interface here a bit inscrutable, like I did for many years.

      I also believe the playground should include Rakudo, especially as with it, Perl does not seem as cracked as the forks of Python. I dont use any 'fancy' techniques in my scripts so I dont forsee any problems with Inline::Perl5, but then again I am still installing it. Its repo is painfully slow.

        Great post, and I'm glad you shared your findings!

        One nitpik though:

        "An humble suggestion would to create here amongst the giants, a *playground* where strict and warnings are left at the gates"

        That likely won't happen on many people's watch here, as use warnings; and use strict; *force* you to write proper Perl code. Essentially, it helps the code writer identify really, really simple mistakes that could cost them hours upon hours of heartache wondering why their code doesn't do what it's supposed to, and eventually quit Perl to move to something else that has these specific checks and bounds on by default.

        I do agree that we need a playground, but I'd still be pushing folks to use the two mentioned pragmas.They are there to help even the most experienced Perl hackers avoid silly avoidable mistakes, and when a newcomer asks questions, it avoids a lot of delay if they run it under them.

        Also, I don't know if you're aware, but Rakudo is the VM for perl6, which is quite a bit different than perl5. That said, to have a playground for that here too would be great.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1179317]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2024-04-25 19:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found