I like plurality in code, when appropriate. I think it's appropriate in array names. When I say code out loud, I tend to assume the listener is skilled in Perl and knows where to put which interpunction. 'arrays' will be @arrays and 'array' will be $array. The latter implies that it is a reference to an actual array, as scalars can't hold arrays.

I go a little further than just variable names. Often, I use plural function names to indicate that the function will return a list. In my DBIx::Simple, you can see what I mean: $result->hash will return a single hash (again, that being a reference to one is implied: a method cannot return a real hash), $result->hashes will return a list of hash(referenc)es.

I don't know any Chinese, and maybe I just want plurality because every language I know changes words (well, not always (sheep, fish)) when they become plural. 'five cow' or 'three car' just doesn't make sense to me, even though I should know there are multiple cows and cars, because of the numbers in front of them. @cow and @car seems strange. I prefer @cows and @cars.

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.


In reply to Re: the "@" indicates plural hence "s" is redundant by Juerd
in thread the "@" indicates plural hence "s" is redundant by princepawn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.