Take the 2-minute tour ×
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It's 100% free, no registration required.

Possible Duplicates:
“User accounts” or “users account?”
Is it correct to say “lesson count” or “lessons count”?

I'm wondering wether or not I should use a plural form noun with a collection name. For example, which one is correct, bookList or booksList (obviously they are variables in a programming language)?

share|improve this question

marked as duplicate by kiamlaluno, Marthaª, RegDwigнt Mar 23 '11 at 14:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
variable_names (I don't like CamelCase much :-) are better off following rules of logic rather than rules of English. If this isn't a dup, it must be off-topic. –  user1579 Mar 22 '11 at 15:01
    
@Rhodri: CamelCase is generally a preference of the language being used. I would advice against fighting the norm if anyone else needs to read your code; your discomfort is less than the discomfort of everyone following behind you. –  MrHen Mar 22 '11 at 15:30
add comment

5 Answers 5

I'd prefer bookList. After all, nobody uses a books shelf, either, but a book shelf.

share|improve this answer
add comment

Why aren't you using books instead of bookList? If this is in an object oriented language, the variable will be declared as List *books which clarifies that books is a List.

Putting the variable type in the variable is fine but it isn't needed as much as it was in the past. If you really want "list" in the var name somewhere I would recommend bookList if it is a list of Book objects (or whatever you are using for a book.)

I would never use booksList. If you are storing lists of lists of books I would recommend finding a term other than "book." Library, shelf or bookLists may work. Essentially, a plural at the end of a variable flags it as a container for objects of whatever was just pluralized. books is a container of book. cats is a bag of cat. dogLists is a container of dogList.

share|improve this answer
add comment
  • Use bookList to store a list of individual books.
  • Use booksList (or bookListList) to store a list of lists of books.
share|improve this answer
add comment

The first thing I think of is Booklist magazine, a reasonably well-known publication of the American Library Association.

I'd go with bookList regardless, because it's easier to say (or subvocalize).
But I think both are reasonable forms, so if you like one or the other, go with that one.

share|improve this answer
add comment

List implies a collection of objects, the object type in the variable name implies that each element in the collection is a single Book as opposed to each element being another collection of Books, in the plural.
If the second case were true, and we were dealing with a multi dimensional array of objects, it would make more sense to use different collective noun to describe the outer collection rather than Books.

e.g.

  • libraryList is a list of libraries, each library contains a bookshelfList
    • bookshelfList is a list of bookshelves, each bookshelf contains a bookList
      • bookList is a list of books
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.