Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^7: Capturing regex from map

by Anonymous Monk
on Sep 16, 2013 at 01:17 UTC ( [id://1054203]=note: print w/replies, xml ) Need Help??

in reply to Re^6: Capturing regex from map
in thread Capturing regex from map

Anyone who understands that assigning a regex to an array assigns the captures; is equally capable of understanding that the same regex in the list context of a map statement assigned to an array will do the exact same thing.

Understanding either or both does not make the OP's code a shining beacon of clarity, IMO.

Replies are listed 'Best First'.
Re^8: Capturing regex from map
by BrowserUk (Patriarch) on Sep 16, 2013 at 01:38 UTC
    Understanding either or both does not make the OP's code a shining beacon of clarity,

    If you understand it, how can it possibly be unclear?

    This is exactly the same ridiculous argument as is proffered here so often.

    Yes. Of course, *I* understand it, but other people might not, so therefore, it is not "a beacon of clarity".

    And if you do not understand it; just say that. Then we can point you to the documentation; and perhaps offer further examples, or a break down of why and how it works, to help you reach the understanding you are lacking.

    Do not advocate the dumbing down of other peoples code, simply because you don't understand it; or you fear that others might not.

    The key to understanding is not pretending the (in this case, hardly) complicated stuff doesn't exist; it is education.

    Don't seek to cover it up, or hide in in a box labeled "wizards only"; explain it.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I'm saying that it can, for the OP's case, be trivially made easier to understand. It did take me a few minutes' head-scratching to see what it did, and it surprised me that the community's response about its clarity was positive.

      In my case, I don't use the list-returning properties of regexps often, nor do I expect map to subtract from or add to the amount of elements in the array. If I need to kill elements, I generally leave a hint such as () inside the map block.

      I do not view this behaviour as dumbing down code at all, but just saving people's heads from excess scratching, that they are able to instantly see what that line does. The Perl community does have a reputation of abstruse write-only code, you know, and I think this line would be a perfect example of excess terseness the community is infamous for. (For the record, I hate Java for its dumb verbosity. Middle grounds exist, too.)

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 11:55 GMT
Find Nodes?
    Voting Booth?

    No recent polls found