Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Use Perl wisely, not cleverly

by Anonymous Monk
on Feb 20, 2003 at 16:34 UTC ( #237127=perlmeditation: print w/replies, xml ) Need Help??

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Use Perl wisely, not cleverly
by ignatz (Vicar) on Feb 20, 2003 at 17:23 UTC
    > ... and religiously thought that Perl will win some imaginary war

    LOL... I had this sudden image of some sort of programming version of Paradise Lost with thousands of Perl Programmers flying around with wings battling the forces of Java and being cast into The Pit:

    If thou usest Perl; But O how fall'n! how chang'd
    From one of Java, who in the happy Realms of Light
    Cloth'd with transcendent brightnes didst outshine
    Myriads though bright.

    So spake th' Apostate Anonymous Monk, though in pain,
    Vaunting aloud, but rackt with deep despare.

    With suddenly tilly rising up and saying
    Better to reign with the CPAN, then serve with the JDK!
    ()-()
     \"/
      `
    
Re: Use Perl wisely, not cleverly
by chromatic (Archbishop) on Feb 20, 2003 at 17:48 UTC
    I worked for lots of big names, and never saw a single serious project in Perl.

    I worked for a big name and never saw a single serious project, or a project done well. I've also never seen China. Arguing a negative from personal inexperience is a very tired logical fallacy.

      Arguing a negative from personal inexperience is a very tired logical fallacy.

      Thank you thank you thank you!

      ---
      demerphq


        Otherwise we could have some great arguments here:

        I have never written a program therefore programs are not written.

        I don't know Perl therefore Perl is useless.

        I have never heard of Randal Schwartz, therefore he doesn't exist.

        I could go on, but I won't. --
        Regards,
        Helgi Briem
        helgi AT decode DOT is

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: [flamebait] Use Perl wisely, not cleverly
by theorbtwo (Prior) on Feb 20, 2003 at 17:16 UTC

    I'm very interested to see your benchmark code, and platform. In purticular, did the perl code have a c-style for loop, or a perl-style? What version of perl was it? Did your C code actualy perform the computation at all, or was it optmized out of existance? Ditto on the Java version. Why do you think this about perl6? Have you seen any benchmarks for parrot? (Try parrot performance vs.(trivial test) the good, the bad, and the ugly to start with. Yes, the perl5 numbers are terrible, but it's outside of it's core competencies by a fair bit. Also, if you change the style a bit to be more idiomatic, it helps quite a bit.) They're quite impressive, and we're still working on them. Did you know that http://amazon.com and http://etoys.com run perl? How about the Human Genome Project? Have you run runtime size comparisons with Java?

    If you're doing heavy numeric computing, don't do it in Perl. Do it in C. Integrate the C with perl. But for ordinary, day-to-day computing, perl is a very good choice much of the time.


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      If you're doing heavy numeric computing, don't do it in Perl. Do it in C. Integrate the C with perl.
      Were you talking about PDL, perchance? :-)

      Makeshifts last the longest.

      Hmm, what about using SSLeay for your numeric computing. I thought it was a respectable compromise when I read up on it :) But then, if you want UBER fast, you shouldn't even waste time with C++, you should go straight for C.

      Hello mister anonymous, usually you don't claim to know so much when you visit.

      smiles

Re: [flamebait] Use Perl wisely, not cleverly
by l2kashe (Deacon) on Feb 20, 2003 at 17:14 UTC
    Since this is flamebait anyway, I'll pipe up as well with...

    Since you talk as if you come from the Java camp, I will hold that assumption.

    How much do you really know about Perl?
    How long have you been programming?
    How long have you been programming Java?
    How long have you been programming Perl?
    Do you know how to optomize your Java code?
    Do you know how to optomize your Perl code?

    The reason I ask, there is a Benchmark site (I cant rememeber for the life of me the URL, but it's a thorn in PM 's side), where the author compares I think about 20 languages to each other. If you look at l2kashe's scratchpad, Im pretty sure I have a function which created a hash of X values, and then reiterates and prints that list, thats run a few magnitudes faster than the Perl code from said site. Why? Because I knew simple optimizations.

    Anyone can spout numbers to support their view... How does that infamous quote go?

    Show me your flowcharts, and I'll remain ignorant of your data set.
    Show me your data set and your flowcharts are useless.

    Serious paraphrasing on my part, but the thought is there. If you wanna flame perl fine, you wanna remain anonymous, fine, if you want to actually have a conversation, print your code.


    /* And the Creator, against his better judgement, wrote man.c */

      Methinks you must be referring to Doug Bagley's Great Computer Language Shootout. This was a subject of discussion here... aah, I've managed to tease it out of Super Search: Perl speed VS. other languages.

      I wrote to Doug a while back and pointed out that a number of his Perl programs were sub-optimal. For instance, I said that his Fibonacci sequence generator was suboptimal, because a clever (sic) Perl programmer would Memoize the function for a nice speed boost. He replied, and I quote (hope you don't mind Doug) I do not allow caching for those tests because they are supposed to be done in the "same way", as I define in the methodology page.

      I fully accept this point of view, even thougth I don't agree with it. But it's hard to know to know where to draw the line, to figure out what it is you're supposed to be testing. My personal view would be along the lines of "the end justifies the means", if you get my drift.

      <update>What I mean by this is that I usually consider these comparative programming exercises more an interface issue than an implementation issue. That is, all I care about are the results. If it passes all the regression test, and is fast as well, I don't care if it's written on punch cards, or transmitted by Morse operators. Therefore I find the argument that they are supposed to be done in the "same way" slightly misguided. All that really counts are the verifiable results. And this is why Inline::C is so nice. It's so easy to code the inner inner loops in your slow (sic) Perl program and speed things up by an order of magnitude.</update>

      The flowcharts quote comes from Fred Brooks in The Mythical Man-Month. Recommended reading. The exact quote is "Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won t usually need your flowcharts; they'll be obvious."


      print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'
Re: Use Perl wisely, not cleverly
by beretboy (Chaplain) on Feb 20, 2003 at 16:57 UTC
    This post interests me, because I like to hear as many opinions as possible. However I would like to know a bit more about about that benchmark. What version of perl/java was it run under? Also, If you feel so strongly about this, why post anonymously?

    "Sanity is the playground of the unimaginative" -Unknown
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Use Perl wisely, not cleverly
by Jenda (Abbot) on Feb 20, 2003 at 17:54 UTC
    Statistics is the art of lying by means of figures.
       -- Dr. Wilhelm Stekhel

    You can prove anything with a "properly" selected "benchmark". I'm sure if you run the same insane "benchmark" in C you'll get much better results than in Java ... does it mean anything? Do you really think it's wise to chose a language based on something like this?

    Unless maybe if you do some heavy numerical math. And even in that case you'd better do just the math in C/Fortran and the rest in something more high level. How important will it be that your program takes five minutes to do what your competitor's need ten if it takes YOU 6 months more to release it?

    How much time do your applications spend doing simple math? How many times did you actually need to do anything even remotely similar to what your "benchmark" measures?

    Jenda

    P.S.: If you did believe Perl is dead you would not need to post this. The people who use the strongest words fear the most.

    I like the OO in Perl. I like the functional features in Perl. I like that I can be both strict and dirty in Perl, just as I need at a moment. You can like what you want, we'll see the results.

Re: [flamebait] Use Perl wisely, not cleverly
by herveus (Parson) on Feb 20, 2003 at 17:22 UTC
    Howdy!

    I see that an Anonymous Coward came out from under its bridge to attempt to incite mayhem. How small and sad.

    The first two paragraphs are simply clueless spew. They are so vague as to be nearly semantic nulls.

    The next one starts off promisingly, but drives off onto the content-free zone.

    Slow? By what metrics? Compared to what? Execution time? Development time?

    Memory hog? OK. It's not the leanest tool in the box, but if you have tight memory constraints, you maybe need to pick a different tool. It is excessive?

    No OO support? Are you still using Perl 4? Or is it just that your pure vision of OO does not match the pragmatic Perl implementation?

    No threads? My, my. You must be on an ancient Perl, for certain. No other explanation comes to mind that does not impugn your intellect and character.

    Next you turn your fevered imagination to an artificial and contrived "benchmark" to claim that Java is an order of magnitude "faster" than Perl. Your "report" of your "testing" is notable for the complete absence of auditable data. Little things like the code you used for each case. Absent that, the claim is so much hand waving.

    Now the Perl 6 dismissal... more hand waving with no substance.

    Finally, unsubstantiated personal claims that appeal to a non-existent authority.

    Wow. Let me pick out the useful bits.

    Perl is a good regexp handler
    Use Perl wisely, not cleverly.

    Signal to noise ration: 1:30? (or am I an optimist?)

    yours,
    Michael

    BTW: Had the screed been posted non-anonymously, I might not have downvoted the post, but anonymous screeds earn that large, negative reputation.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Use Perl wisely, not cleverly
by perrin (Chancellor) on Feb 20, 2003 at 17:58 UTC
    You appear to be quoting from one of my posts when you talk about competing with Java and ASP.NET. I guess you haven't read my other posts, or you would know that I have done a much more substantial benchmark than you, and Perl won. In a test using Resin (one of the fastest servlet containers around) and mod_perl, fetching data from an Oracle database and displaying it on a page was faster in Perl. There are no doubt specific tests where Java would be faster, but most of my work centers around building web sites and using databases, and Perl definitely seems to be equal or better than Java there.

    As for the "big names" you worked for, I doubt they are as big as the companies that do use Perl every day to power their sites: Yahoo, Amazon, Ticketmaster/CitySearch, etc. Incidentally, these are also the companies that look like they might be able to make a profit on the web.

Re: Use Perl wisely, not cleverly
by dragonchild (Archbishop) on Feb 20, 2003 at 18:35 UTC
    Some "big names" that I have worked for that use Perl for "serious project"s:
    • Motorla - every single non-RF test that is run on the software that runs its CDMA base stations is through an application I worked on. Pure Perl. (Was client-server, OO, extensible on-the-fly, has its own macro language, etc.)
    • Verizon Wireless - an integration project of all of VZW's network and inventory information in its switches was done in pure Perl.
    • Mastercard - one of its bread'n'butter reporting tools is in Perl/MySQL.
    Are those names big enough for you?

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

    A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Use Perl wisely, not cleverly
by BrowserUk (Pope) on Feb 20, 2003 at 23:04 UTC

    I'm not at all sure whether everything you say regarding Perl -v- other languages is entirely wrong, though am pretty sure, to my own satisfaction at any rate, that not everything you say is correct. However, I'm more interested in your motivations for saying what you said?

    You remind me of the (faith agnostic here) religious zealot in the old-time movies who parades up and down in public places with a placard saying "Judgement day is coming", and yelling "You're all sinners, and you're all going to hell". I always wondered why anyone would do such a thing?

    I mean, if his beliefs are correct, then when judgement day comes, he is going to Heaven and the disbelievers are heading to that other place. What is he trying to achieve? Is he trying to save their souls? Or maybe he's just gloating.

    It always seemed to me that rather than concerning himself with the fate of those that do not share his beliefs, he should spend his time concerning himself with what happens if his own beliefs are wrong. What will be his fate if he has it wrong and the 'one true faith' is not his faith, but some other faith?

    What happens if the god of that other faith is as vengeful as the one he believes in, and when that judgement day comes, he is the one headed to hell?

    To summarise, it seems to me that your post was an attempt to convince yourself that your own beliefs are correct and that the time and energy you expend on the penance of verbose syntax, whilst wearing the bonds of strong typing, on your shotgun-imposed march to toward the true light are actually worth it. If your right, your on your way to heaven and many of us will have to pay the price for the delinquent fun we've had with Perl.

    What if your wrong though...

    Then there is the possibility that your idea of Heaven is my idea of Hell, but that's another discussion.


    Examine what is said, not who speaks.

    The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.

Re: Use Perl wisely, not cleverly
by demerphq (Chancellor) on Feb 20, 2003 at 20:18 UTC

    The most poisonous view about Perl is that Perl would be able to deliver everything, and Perl would be able to compete with Java or ASP.NET.

    Actually it does compete with them. Every day. Quite well too. And judging by the number of perlish features that were either built in, or sneaked in to them I'd say that at least a few non-morons (unlike yourself) in the respective companies are well aware of it, and doing their best to compete back.

    Ultimately competetion like this is a good thing. If the next language I learn includes features from them all (perl6 ?) then my personal world will be a better place.

    Incidentally do you plan to post your benchmarks, or is the assumption that most of us have made (that you are a jackass troll) correct?

    ---
    demerphq


    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Use Perl wisely, not cleverly.
by gmpassos (Priest) on Feb 21, 2003 at 03:12 UTC
    Well. First, I think that you don't understand much about Perl, and Java too. How about you learn more, study more, and after this you will be able to make some real comment. Opinion without informations doesn't have value!

    About the speed of threads of Perl. Well, send the test codes, and you will see that all the "lovers of Perl" will have a open mind to analyze it.

    Other thing, never say that Java is fast! It isn't! It's the slowest language that exist, and sun know that. I'm a developer of Java too, in the security area, and we know that Java is very slow. Some times we need to implement things in C/C++, and link to Java, because of this.

    About the OO. Well. Perl has OO, and has everything that OO can bring. If you think that Perl doesn't have OO, or have missed something, tell us. Is not hard to implement anything on Perl, since every one can do this! We always have our code!

    And if you don't know, sun help a lot the Perl community, since they respect us! If I'm not wrong they made some donation for CPAN with a new server when CPAN was slow!

    About Perl is dead. Humm... I think that something that is always growing, and being better, is alive. With all the respect of Java, since I use it too, I think that Java is more dead than other thing. Don't forget that Java is only Java because they made a good marketing (is a commercial initiative of sun). and Perl don't need, since it self made the marketing.

    You say that "never saw a single serious project in Perl". Well, this only show that you don't know nothing about nothing. Man, Yahoo! use Perl, and was fully made in Perl. Without Perl Yahoo!, and other web sites, will doesn't exist. No more comments!

    Graciliano M. P.
    "The creativity is the expression of the liberty".

Re: Use Perl wisely, not cleverly
by mowgli (Friar) on Feb 21, 2003 at 09:12 UTC

    OK, here is yet another reply from someone who likes Perl a lot and uses it frequently for all sorts of projects (both privately and professionally).

    When I started reading this post, I first thought it might be an interesting, insightful post that would offer some food for thought on when Perl would be the best solution to get a job done or when other languages might be prefurable, as well as some thoughts on style, maintainability and the like. I'm rather sad it turns out to be just flamebait, though - and it really seems to be just that, with claims like "Perl has been dead for years already" etc. that are then backed up with statements like "I worked for lots of big names" (implied: "so I know everything about programming, or at least more than you who reads this") instead of some actual facts.

    You are entitled to your opinion, of course, and if you don't like Perl or don't want to use it for anything beyond simple scripts (if even that much), that's perfectly fine, but why do you come to a site dedicated to discussing Perl when you don't actually want to discuss anything? Just saying, in effect, "Perl sucks and if you don't agree, you're naive and / or a moron" is simply rude and serves no purpose. Really, I can understand why you posted this anonymously.

    --
    mowgli

(jeffa) Re: Use Perl wisely, not cleverly
by jeffa (Bishop) on Feb 25, 2003 at 15:46 UTC
    Normally i would just shake my head, mutter something like *tsk* *tsk* and move on. But this is some funny stuff. Sad, but funny. Who do you think you are? You, a registered user, post this crap anonymously and expect us to suddenly drop Perl and start embracing Java? Maybe you haven't read Re: Re: Perl falls victim to shifting trends(Opinions/Comments From The Other Side) yet ...

    This would make more sense if you were selling us .NET instead. Why oh why does one Open Source solution have to attack another? Shouldn't we be combining our efforts to find ways to make all of these Open Source languages work together? Can't you see that Microsoft revels in these banalities? Or are you really just spreading their FUD?

    Personally, i think Java is tedious language, but you don't see me posting Perl advocacy over at JavaJunkies. Since i don't really like Java (hey, i gave the language a fair shot - i even got certified!), i don't bother to share that opinion with that community. They don't need it. We don't need yours.

    hardburn posted a clever little anecdote along the lines of "Java is good for building castles, Perl is good for building huts." I couldn't agree more. Unless you have a team of experienced Perl programmers, you have no business implementing the solution in Perl. Java is a great language for experienced and novice programmers, Python spans that gap even better. I just happen to love Perl not because i invested time to learn the language, but because it is such an expressive language that it allows my programming skills to grow. I am not constrained by bondage and discipline and therefor i am allowed to invent new things, even at the expense of re-inventing a wheel. With great power come greater responsibility. No matter what language my PHB of the year requires me to use, i will always use Perl (behind his/her back) to make my life easier. I suspect a lot of others do this as well. Perl is dead? Long live Perl.

    One thing i have noticed around here is that most of the questions that are asked and answered deal with 'hut' like problems. These 'serious projects' you speak of probably fit in the 'castle' category, and as such, are out of the scope of this community and in the hands of the PHB's that 'run the show'.

    So, do us all a favor, next time you get the urge to sell Language X at Language Y's communtiy .... DON'T! Use your time learning more about one or the other and leave the conversation for "beer talk" when you take a break.

    Oh by the way, regarding your "benchmark", you just compared two huts. The Java hut may be faster, but it also has an extra moat, drawbridge, and dungeon that you don't need. :P

    jeffa raises the phoenix from the ashes and gets back to making impressive huts

    "real programmers program ... the others complain"
Re: Use Perl wisely, not cleverly
by simon.proctor (Vicar) on Feb 21, 2003 at 09:29 UTC
    Maybe Perl is slow for you because you forgot to use it cleverly.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Use Perl wisely, not cleverly
by steves (Curate) on Feb 20, 2003 at 16:57 UTC

    How bold of you to post this anonymously.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Use Perl wisely, not cleverly
by shirkdog_perl (Beadle) on Feb 21, 2003 at 13:36 UTC
    Fellow Monks, we must not loose our focus on such threads. We come here to practice our devotion to Perl. This is the second posting I have seen which incites a riot among the ranks of the Perl Elite.

    Like I said the other day:
    BOTTOM LINE: Perl may not be the right solution for every job. However, there always is a solution in Perl.
      If "the ranks of Perl Elite" is the XP point system used here, this view is really shallow.

      Most of the questions asked here are normal questions, and most of the answers given here are normal answers. Most of the time, to write up a reply does not require cleverness, or to be super.

      Because nobody knows everything, because there are monks just started to learn Perl... all those create questions => and you may happened to know what he/she doesn't know, so you come to help. It is just that simple.

      Did he/she ever beg your answer or comment, NO, if you don't answer, someone else will. Of course, if you provide an answer and be polite, doesn't matter whether your answer is right or wrong, he/she appreciates your effort. If you think it is a must for him/her to feel grateful, sorry, there is no obligation.

      Most of the solutions provided here are normal solutions (otherwise as merlyn suggested VERY strongly, it would be perl2exe'd, oh, no, he said that is no longer a good solution any more, see it would become quite a worry for you to know the answers, if they are not "normal" ones), there are more than ten thousands, or maybe hundred thousands people know those answers, you answered it:
      1. because you type more fast
      2. because you see the question first
      3. because you are in a mood to answer
      4. because you have the guts to answer
      5. ...
      6. ...
      7. NOT BECAUSE YOU ARE THE ONLY PERSON KNOWS THE ANSWER
      This is the second posting I have seen which incites a riot among the ranks of the Perl Elite.

      The true "Perl elite" wouldn't bother with such flames. In fact, I think at least half of them have a very low opinion of this site's level of discussion.

        And perhaps that is what makes them the "true Perl elite"--they are elitist. Another word for that is "snobs".

        They have forgotten what it is like not to know all the answers; they beleive that their opinions are the only opinions; they think of Perl as 'their' language and resent that newbies, ex-VB programmers, AOLers, web-designers are discovering 'their' language and revile them for it.

        Perl is designed to help people learn the bits of programming they need right now without forcing them to learn the techniques they aren't ready for. But when they are ready for them, Perl tries to be there too. We just don't tell the beginners that the speedometer on their golf cart wraps around several times.

        Larry Wall. 02/09/2002

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2021-12-01 22:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (15 votes). Check out past polls.

    Notices?