Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Plural variable naming (or not?)

by Juerd (Abbot)
on Mar 19, 2002 at 12:27 UTC ( [id://152717]=note: print w/replies, xml ) Need Help??


in reply to Plural variable naming (or not?)

As usual, it's a matter of style :)
My style is:

$singular @plural %singular
With one exception: I often have %subs, a hash that contains sub references. For some reason, I have always put that in plural.

A good document on style is slashstyle (Note: I don't agree on many points, but it's nice to read, and gives an indication of the many possibilities.)

U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk

Replies are listed 'Best First'.
Re: Re: Plural variable naming (or not?)
by Sinister (Friar) on Mar 19, 2002 at 13:04 UTC
    It is not merely a matter of style. It is also a matter of program context, and wheter or not the name is more ambigious with the plural (or singular (thanks for freshing up the mind)) and may not provide as much context as could be intended.

    Therefor a programmer expecting to have his code reviewed or updated should be well considering the use of plural or singular form on each variable name, and the matter of style should be thrown overboard on this specifick isue... (Or should it not...?!?)

    er formait hyarya.
    "Field experience is something you don't get until just after you need it."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-03-28 10:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found