Peng said:
1. "array" is the stupidest name for an array. [...]
my @word = qw/ a b c /;
The name of a variable should tell the reader something about its
content and/or purpose. So I would agree that @array is in almost all
cases a very stupid name, as it doesn't tell you anything except that
it's an array, and it does so redundantly ("@" and "array").
However, in this example, the only thing important is that is an array.
It isn't important what kind of data is in the array (except that the
elements are strings or can be stringified) or what the data is used
for. So @array is ok, because it tells you that this is "just an array".
@word, however, is a bad name. It conveys that the array contains
"words". This then causes the reader to wonder what a "word" is (an
English word? No, "b" and "c" are not English words. Some other natural
language? Maybe. Strings matching /^\w+$/? Maybe.) and whether the
example is still valid if an element contains data which is not a
"word".
So @stringifiable_data might be ideal but it's a bit long. @strings is
already a bit too narrow (is 1 a string? Is an object with an
overloaded "" operator a string?), in about the same sense that @array
is too wide. So I don't really see that one of @stringifiable_data,
@strings or @array is clearly better than the others.
hp