Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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.


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

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (6)
    As of 2018-05-27 08:39 GMT
    Find Nodes?
      Voting Booth?