Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Abigail-II: That "three line patch" is one of thousands that bloats Perl. If you want to discourage people from calling this a bad thing, we can't stop you.

With regards to your argument that nobody considers it bad style that the return value of print and other functions are not checked, I disagree. Many people consider it bad style, but see no practical solution to the problem. People have argued for years (on and off) that print should really raise an exception. The matter has never been closed off. It has only been put off.

With regards to your argument that it is really a bug that map in void context creates a list, I find your argument to be faulty. It is only the knowledge that the 3 lines patch has been applied (i.e. intimate implementation knowledge of the language) that has since encouraged people to continue to use map in void context. Intuitively, and according to the original documentation, most reasonable people would assume that a list was created, and would only be pleasantly surprised to find that the case was optimized now so that the list is not created.

With regards to your last argument that calls all people who disagree with you "sheep", and points out that no patch was provided, I think you have missed the point. The people who consider it bad style did not *want* to submit a patch. They did not *want* Perl to be officially implemented to encourage such a bad style. And yet, now that a patch was submitted, and included, this very thing has happened. Respected members of the Perl community such as yourself encourage (or silence the discouragers, which is the same thing) the very odd practice of using a list transformation control structure to iterate through a list.

It isn't as if this sort of practice is un-Perl. After all, Perl is the language that encourages people to use operations like "tr/a/a/" to count the number of a's in a string.

I use Perl because it is practical. I don't use it to ensure that non-Perl-familiar members of the community will be unable to understand my code.


In reply to Re: Think for yourself. by MarkM
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-19 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found