develooper Front page | perl.perl6.stdlib | Postings from August 2000

RE: Define consistent and standard

Thread Previous | Thread Next
Garrett Goebel
August 7, 2000 07:58
RE: Define consistent and standard
Message ID:
From: []
> * Plural variables should have plural names
> 	@employees, @items, %contact_details
> * Hash names should be written so that looking up an element 
> reads clearly:
> 	$email_address{Skud} reads as "the email address of Skud"

Shouldn't that be $email_addresses{Skud}?  Well I guess so if the following
rules apply...

> * Hashes with scalars as values should have singular names:
> 	my $address = $email_address{Skud};
> * Hashes with arrayrefs or hashrefs as values should have 
> plural names:

Is this really advised? 

Hashes and arrays hold _things_. Scalars hold a _thing_. I.e. Scalars are
singular and Hashes/Arrays plural. Seems pretty straight forward. Should we
really want to make the plural of a hash dependant on plurality of the
thing(s) contained in the hash? Sounds like a recipe for unnecessary


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About