Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"items list" or "item list"

English is not my native language and I can't understand how to write the specified samples right. When you say something what aggregates plural object such as "collection of stamps" you can say alternatively: "stamps collection", am I right? If you will say "stamp collection" it will mean some "collection" which is a single "stamp".

But often I see classes with names like "ItemList" - doesn't it mean that such class is a list which is an item of something else? Such sample is more flaring:

class ItemList: List<Item> 

Isn't it have to be so?:

class ItemsList: List<Item> 

Why is it rarely written so? Or is it some programming languages naming convention? Or just proper english sentences? :)

like image 932
Slaus Avatar asked Mar 20 '12 10:03

Slaus


People also ask

What is item list?

A list of items of any sort—for example, Top 10 Movies About Weathermen, or Top 100 Party Songs. Not to be confused with HTML lists, which are often used only for formatting.

What is plural of item?

item /ˈaɪtəm/ noun. plural items.

Can a list be one item?

Absolutely. A list is not defined by quantity. It's defined by semantics. So a list can consist of only one element if only one item applies to the list's purpose.


2 Answers

In English, a "collection of stamps" is a "stamp collection". (At best, "stamps collection" would be understood).

In programming, I'm not entirely sure why, but we1do sometimes use the form "StampsCollection".

It may be because we try to use more precise and logical lingo than traditional English provides; we start with the name "Item", pluralise it to "Items", then be precise by stating that our collection of "Items" is a "List" rather than an "Array" or some other implementation.

You're likely to see both variants, though, and it doesn't really matter.

Certainly, neither in English nor in programming would ItemsList imply a list of collections of Items, at least not to most people.


1 ... for some value of "we". Naming choices are, of course, down to personal preference. However, I've personally seen this as a tendency.

like image 181
Lightness Races in Orbit Avatar answered Sep 18 '22 09:09

Lightness Races in Orbit


I find ItemList much more descriptive. It is a list of objects of type Item.

On the other hand, if you had a collection of Item objects, you could call it Items, and ItemsList would designate a list of collections.

like image 36
Luchian Grigore Avatar answered Sep 17 '22 09:09

Luchian Grigore