[Chicago-talk] PBP - What to name a hash_ref?

Craig Frooninckx medicldr at gmail.com
Fri Oct 7 08:07:50 PDT 2005


So what would the hash_ref read like?

$author_of_ref->{'Perl Best Practices'} = 'Damian Conway';

On 10/6/05, Jay Strauss <me at heyjay.com> wrote:
>
> Paul Baker wrote:
> > On Oct 5, 2005, at 9:55 PM, Jay Strauss wrote:
> >
> >
> >>In PBP (I haven't finished it yet) but so far he hasn't recommended a
> >>naming for a hash_ref.
> >>
> >>hashes are blah_of
> >>refs are blah_ref->
> >
> >
> > I haven't gotten my copy yet. What's the reasoning behind the _of for
> > hashes?
> >
>
> Actually on re-reading, PBP recommends ending the hash name in a
> preposition specifically:
>
> "Moreover, because hashes often store a property that's related to their
> key, it's often even more readable to name a hash with a singular noun
> followed by a preposition"
>
> $author_of{'Perl Best Practices'} = 'Damian Conway';
>
> Ironically, he goes on to give some examples that don't end in a
> preposition. I guess it's more of a guide-line. Try to make it read
> naturally.
>
> Jay
>
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/chicago-talk/attachments/20051007/519c5293/attachment.html


More information about the Chicago-talk mailing list