Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Why I choose Perl

by Ovid (Cardinal)
on Dec 23, 2002 at 18:18 UTC ( [id://221919]=note: print w/replies, xml ) Need Help??


in reply to Why I choose Perl

One of my fellow programmers uses Python and loathes Perl with a passion. I almost sent him this link, but I realized that he would simply say "yeah, show me why Python takes longer than Perl". Sure, I could show him a few useful one-liners that you can't do in Python due to the formatting issues, but when it comes to building real applications, I simply don't know enough about Python to make a comparison. Any recommendations from anyone?

Cheers,
Ovid

New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)

Replies are listed 'Best First'.
Re(2): Why I choose Perl
by cjf-II (Monk) on Dec 23, 2002 at 19:03 UTC
    I simply don't know enough about Python to make a comparison. Any recommendations from anyone?

    Learn Python :).

    Update: since this post is geting downvoted into oblivion, I'll take that as a suggestion I should elaborate on my reasoning:

    • Learning other languages will improve the way you program in Perl. You'll find new ways to approach certain problems.
    • Knowing more languages increases your employability.
    • You'll be able to examine the code of apps you use that are written in Python. You can then assess their suitability for a particular task more efficiently.
    • You will better understand the differences between the languages and be able to contribute more to a debate on their respective benefits.

    And the list goes on...

      I think your short answer deserved a ++ in itself.

      I have considered learning Python and Ruby for a while and intend to do it as soon as my projects let me relax a little (which may as well mean never). Learning something is generally good and Python has its merits. Once you know it, you might either decide that it's better than Perl at some tasks, or borrow idioms and techniques into your Perl programming practices. You might also decide it's not worth much effort and offer people detailed reasons why.

      I recently started programming in Java and even if some tasks are made infinitely tedious, the way the language is designed gave me a better insight on software design and programming techniques. Now my OO-design is a bit more careful and my Perl code a bit cleaner. And even if Perl remains my favourite language, for any new project I consider using Java and sometimes decide it's a better choice for the task at hand. Furthermore, during a talk I gave recently I could use it as a benchmark to show Perl's effectiveness at string and template handling ;-).

      Cheers

      Antonio

      The stupider the astronaut, the easier it is to win the trip to Vega - A. Tucket
        I've chewed through a Ruby book myself recently. I find it's a really nice lil language. I wouldn't mind at all if circumstances forced me to work in it. As it is though, seeing how its blackbox approach to "clean" OO frees one from the headaches Perl OO can induce only made me desire Perl 6 more. :) I plan on doing a bit of actual coding in Ruby just to get a better feel for the language as I do already like the looks of it, but chances are it won't manage to pry me away from Perl by a long shot, and if only because its community and code archive are so small for the time being, although none of this relates to my tendency to write long run-on sentences. %-)

        Makeshifts last the longest.

      Howdy!

      By a quirk of timing, this was revealed to me at the same time I posted my reply that appeared immediately above it. It took me a moment's careful looking to confirm that it wasn't aimed at me...however, the shoe fits :)

      Right now, my new employer (big sigh of relief over leaving the coprs of the unemployed) wants me to come up to speed on the tools they use, and Python isn't one of them, but Perl is. I've already caused the head tech in my group to suggest that we need to use Perl a lot more (vice Korn shell, mostly).

      I keep telling myself that it might be useful to take a real look at Python (or Java), but somehow it never makes it high enough on my priority list.

      I call it laziness...you might call it sloth. I might even not disagree.

      yours,
      Michael


      Update: I got it in one; I'm just explaining why that approach is not suited to my situation at this time. I took all your points to be implicit...

      Hear, hear. I took the time to learn enough Python to be dangerous (I've actually used its xmlrpclib to implement a few useful things at work) and I can cite specific warts that put me off the language as a whole (other than the whitespace thing).

•Re: Re: Why I choose Perl
by merlyn (Sage) on Dec 23, 2002 at 18:24 UTC
    Pick any five mature packages out of the CPAN, and five tasks they let you do for the cost of a download and a skim of the manpage.

    Now ask your Python friend about how long it would either be to (a) handcode that in Python, or (b) find some package in their joke-of-a-non-CPAN to do the same thing.

    "It's the code reuse, stupid." {grin}

    This gets it out of the actual coding, and into the culture. Perl culture kicks hiney.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      So what happens when Python and Java come out with their own archives? CJAN's on its way and a Python archive will be coming shortly as well (and they already have a good number of modules). Given the number of developers, I doubt they'll have much trouble finding contributors.

      CPAN's advantage is going to be quickly reduced. If you want to prove Perl's superiority, why not focus on the actual language designs instead? Who knows, maybe the discussion will lead to improvements in all of the languages. Simply saying "Perl's better because it has more modules" leads me to believe you don't know Python well enough to comment on the actual language.

      Preaching to the converted isn't much of a challenge either. If you really want a good debate on the subject, bring it up on a Python mailing list (in a nice non-flamebait way ;).

        I think you very much overestimate the likelyhood that any of these archive projects will go anywhere. CPAN isn't new--it's been around for ages, and it arose from the ideas that were part of CTAN before it. This is not new stuff. Neither is it a new thought for the Python/Java/Ruby/VB/C/C++/Haskell/Scheme/Lisp/whatever communities to have their own. You'll note how many of those have materialized.

        Building a CPAN network is dead-simple. It doesn't require much code, it doesn't require much talk, it doesn't require much planning, and it doesn't require much coordination. (Ask Jarkko) What it requires is a good chunk of sysadmin-ish effort on the part of a few people. You'll note how often that happens.

        Archive networks have a chance of success when they're set up by someone with sysadmin skills, not programming skills. That's why so many attempts fail--programmers aren't sysadmins. Some very few programmers are also sysadmins, or sysadmins are programmers, but being a programmer confers zero (and sometimes negative) admin skills. Worse, most programmers wildly overestimate their admin skills, and often actively discourage those few who actually have them.

        I'd love to see more CPAN-style networks set up. I won't believe one exists for a language until I actually see the damn thing in use. Until then it's fancy vapor with little hope of success.

        Howdy!

        I went to cjan.org. If there is a reasonable body of reusable code there, it seems to be well hidden. It appears that CJAN is still a concept, not an actuality.

        I'm not trying to dismiss Java or Python; I know how to spell each. Beyond that, I can't make an informed comparison. I doknow that Perl and CPAN work for me.

        CPAN appears to remain one of the strongest features of Perl. It also appears that "competing" languages are still a ways off from offering a similar, comprehensive solution for code sharing.

        yours,
        Michael

(jeffa) 2Re: Why I choose Perl
by jeffa (Bishop) on Dec 29, 2002 at 03:15 UTC
    Well ... for what it's worth ... i purchased the Python Cookbook recently and, where i find the Perl and PHP Cookbooks fun and informative, the Python Cookbook has been rather dull and tedious. I will say that i would rather use Python over Perl or C for threads, but dealing with Python's types is PITA after being spoiled by Perl. Python's sockets are nice too, as well as Python GUI's ... but when it comes to CGI, XML, system administration, databases, and data munging, i think Perl is the better choice. Still, i recommend the Python Cookbook - if you have to code Python, it is better to have it than to not have it. ;)

    Re: one-liners - i think that one-liners are a good way to show a Python programmer why Python takes longer. The idea of one-liners is that you don't have to save one-liners somewhere and then search for them later - you write them on the spot, ad lib. They are true throw-away scripts, much like Python coders use the command-line interpreter to test code. The more one-liners you write, the better you get at coming up with one-liners on the spot. I'm not saying that one cannot write one-liners in Python ...

    python -c 'print [x for x in ("just","another","python","hacker")]'
    but without options like -n, -p, -M, or -a, Python just doesn't cut the mustard regarding one-liners. Since all these options do is basically add canned code, the only reason i can think of why Python does not offer similar functionality is because the Python camp did not even know that such functionality is useful and desired.

    Now, if i were a manager i would probably choose Python, but only if my programmers were not skilled enough to use a powerful and dangerous language like Perl. I was not ready for Perl until about 4 years after i was introduced to it, but now there seems to be no going back. :)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      I was not ready for Perl until about 4 years after i was introduced to it, but now there seems to be no going back.

      Very true. I wrote some horrible Perl code for 2-3 years before I even started to fully grasp it, and I'm only now feeling anywhere near confident that I'm writing decent code, nearly 5 years later. (Though I think that someone who has been exposed to other truly list oriented languages like LISP will have significantly less trouble.) And while the code I used to write is a far cry from what I can do now, I'm still nowhere close to a merlyn or Abigail.

      "Powerful and dangerous" is a very good way to describe the language. You need a fair bit of excercise to wield this tool well without cutting yourself, but the sheer power of the spells a vetted Perl wizard can cast is amazing.

      (Can you tell I'm totally infatuated? :) )

      Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-23 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found