On naming collections:
Naming collections: Plural names for arrays, lists, etc; single names for dictionaries, hash maps, etc. From Perl Best Practices:
- Because hash entries are typically accessed individually, it makes sense for the hash itself to be named in the singular. That convention causes the individual accesses to read more naturally in the code. … On the other hand, array values are more often processed collectively … So it makes sense to name them in the plural, after the group of items they store. … If, however, an array is to be used as a random-access look-up table, name it in the singular, using the same conventions as a hash.
Naming convetions for key-value maps: For dictionaries, name things {{ValueType}}s_by_{{KeyType}}s, e.g. counts_by_words, sizes_by_filenames. Use plural for describing keys or values (e.g. "counts").