Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
As Zaxo said, it was never deprecated. However, for years there was a band of people that never listened to Larry. Larry said that Perl was there to serve the programmer, and the programmer should never be a slave to the language. Yet, this band of people decided programmers should know the details of the implementation, and should hence know how inefficient perl handled map in void context (due to the fact that map, unlike most other functions, didn't inspect in which context it was running). And this band of people would throw dirt at any programmer that used map in void context, scolding them, as if the Perl programmers were guilty of the perl programmers neglect of making map efficiently. (Use of capital and lower case in the previous sentence is very significant).

There was another round of mud throwing going on on Usenet last month. It prompted me to followup with the following (I've responded to the stone throwing similar for years):

Poor style? Why? Return values of print and assignment are usually not used either, but noone considers that poor style.

The fact that map builds and discards a list when it's used in void context is a bug in *perl*. It's not poor style of the Perl programmer; the fault lies with the perl programmers.

But noone has found it seriously enough to provide a patch. For years, a whole chorus on people in this newsgroup chant "poor style" whenever someone uses map in void context. But none of those sheep has ever bothered sending a patch to p5p.

And that triggered Tassilo v. Parseval to write a patch. It turned out to be a three line patch. Imagine, all the energy wasted scolding at innocent programmers, while the fix was relatively easy!

Don't get intimidated to easily when people are chanting "bad style". Chargo cult chanting is in the Perl world far more common than cargo cult programming (although many people will easily chant "cargo cult programming"!). Think for yourself. And people that chant "bad style", think for yourself too. Don't mindlessly copy the behaviour of someone who is "famous". That's how religions start. Think for yourself.

Abigail


In reply to Think for yourself. by Abigail-II
in thread is the use of map in a void context deprecated ? by arno

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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 making s'mores by the fire in the courtyard of the Monastery: (17)
    As of 2014-07-14 14:49 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      When choosing user names for websites, I prefer to use:








      Results (263 votes), past polls