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

comment on

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

I also dislike cute uses of fat comma. It was meant to separate a hash key from a hash value. And in Perl6, using it for something other than that is likely to break (as near as I can tell).

I only use fat comma when the thing on the left is a string (which all hash keys must be) and the thing on the right is a scalar (which all hash values must be). If it weren't for the immediate proliferation of cute uses of fat comma, fat comma might have been improved to provide scalar context to it's right so that my %hash= ( foo=>getFoo(), bar=>getBar() ); would no longer be susceptible to getFoo returning an empty list (or more than one item).

But I do sometimes use fat comma when the left-hand side must not be quoted, just like I sometimes use $hash{...} when the key expression must not be quoted. These are a couple of the reasons why I make it a habit to write COMMA() not COMMA if it is a constant (subroutine).

When I see =>, I think "key => value". Some people use cute fat commas to provide extra separation between things. Some people use cute fat commas to show a closer association between two items (like it was intended to be used when listing the key/value pairs for a hash). Some people use cute fat commas to indicate a direction of flow (which can only be done it one direction, of course). I'm surprised these people don't get really annoyed at other people's conflicting uses of fat comma. If the fat comma doesn't mean "key => value", then it is just (usually minor) obfuscation to me, since I don't keep a list of which authors use their cute fat commas which ways; I only track what the purpose of the fat comma was.

- tye        


In reply to Re^4: Use of the m/.../g idiom in list context (formatting MAC addresses) (use of fat commas) by tye
in thread Use of the m/.../g idiom in list context (formatting MAC addresses) by grinder

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 contemplating the Monastery: (4)
As of 2024-04-24 18:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found