in reply to the "@" indicates plural hence "s" is redundant

I can see your point, but I think my brain works differently. :-)

I write the names of arrays with a trailing "s", because seeing something like @function really throws me off. It looks like there is some sort of mismatch between the name of the variable and its plurality. To me, the "s" isn't redundant... it confirms at a glance that there are (possibly) multiple elements in the variable.

Of course, sometimes even a scalar variable can hold a reference to multiple elements (as an array reference, for example). In this case, there is no "@" to indicate plurality, so the "s" is necessary (in my mind, anyway). So, in my coding style,

That's not to say that either style is necessarily better. Mine just fits my brain better. I'm curious to see what other people think, as well.

-- Mike

--
just,my${.02}

Replies are listed 'Best First'.
Re: Re: the "@" indicates plural hence "s" is redundant
by bart (Canon) on Oct 30, 2002 at 23:47 UTC
    I have another reason for not using an "s": I generally write
    $x = $item[3];
    because
    $x = $items[3];
    doesn't make any sense.
      $x = $items[3];

      $x is the third element of this collection of items. No problem. Except my off by one error. ;)

      Really, in my mind, as I'm typing $items, I'm thinkink that this is a collection of items, but now I only want this [3] particular one. So keeping the "s" makes sense. YMMV