9

My question is connected with programming. I'm not sure how to name my class.

Should it be ItemQueue or ItemsQueue? We are talking about queue, which stores many items. We can add new ones or remove existing. Similary, what about file list/files list? I have always wondered which form should I choose.

RegDwigнt
  • 97,231
stil
  • 193
  • 1
    In most cases, nouns modifying nouns should be singular. For instance, it's Shoe Store, with singular Shoe, even though people normally don't buy only one shoe there. – John Lawler Apr 18 '14 at 16:05
  • 2
    http://programmers.stackexchange.com/questions/103720/classes-naming-singular-or-plural – Alex K. Apr 18 '14 at 16:06

2 Answers2

6

To keep in line with what most people are accustomed to it needs to stay singular. Queue and list already convey that there will be multiple, so having the plural word almost makes it read possessive.

The two most common example using file are:

  • File Browser
  • File Manager

Not files.

RyeɃreḁd
  • 16,833
  • I agree it should be singular: ItemQueue. It gets fun if you want to have a queue of lists. You might then name it Queue<List> itemListQueue (instead of itemListsQueue, which doesn't sound right). :) – brandonjsmith Apr 18 '14 at 19:19
  • What about "high building count" vs. "high buildings count"? I'm not a native speaker, but to me the first variant sounds more ambiguous and can be read as "high (building count)" vs. "(high buildings) count". For me, the awkwardness remains even when the adjective is not very compatible with the word "count" (e.g. "preceding click count"). – Ark-kun Jun 24 '17 at 03:41
0

You can call it:

listOfFiles in camelCase

or

FileList

create listOfFiles from items in itemQueue

I'd prefer the first one since it is clearer and easier to extend:

Also see file-cabinet or filing cabinet.

DisplayName
  • 1,612
  • 1
    Except that a queue is not a list. I wouldn't use FileList for a queue containing files or filenames. But I would if it were a generic list (e.g. in .NET: IList). – Cyberherbalist Apr 18 '14 at 16:46