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

•Re: Plural variable naming (or not?)

by merlyn (Sage)
on Mar 19, 2002 at 14:46 UTC ( [id://152733]=note: print w/replies, xml ) Need Help??


in reply to Plural variable naming (or not?)

I support $singular and @plurals as a general convention. However, for hashes, I tend to think of hashes as providing a mapping function between a key and its value, so I frequently name it as a f() style, as in %last_name_for or %last_name_of or %has_subentries. That makes it clear to the reader that I'm holding a mapping in that hash.

-- Randal L. Schwartz, Perl hacker

  • Comment on •Re: Plural variable naming (or not?)

Replies are listed 'Best First'.
Re^2: Plural variable naming (or not?)
by Jeffrey Kegler (Hermit) on Jan 26, 2016 at 21:57 UTC
    For the $singular and @plurals, I had independently come to Randal's style. I haven't used his style for hashes, but it looks good and I am going to try it.
      Only a mere 14 years later!

      -- Randal L. Schwartz, Perl hacker

      The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

        Nice to see you! :P

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 23:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found