I'm not sure is this right place to ask so correct me if I'm wrong.
The case is that:
one category has one code
we want to get list of codes for multiple categories
Which version is correct and why?
getCategoriesCodes()
or
getCategoryCodes()
I see this problem from two points of view, one is the English grammar, and the second one is the clean code and code meaningful naming.
Please give me your opinion which method name is better and add note is English you native language.
getCategoryCodes()
is preferable.getCategoriesCodes
implies to me that I am getting multiple codes for each category, or that the codes relate to the collection of categories, rather than a code for each category.getCategoryCodes
sounds to me like one category has multiple codes. To refer to a list of category having one code, I would name the methodgetCategoryCodeList
orlistCategoryCode
.getCar().getDrivers()
orgetDrivers(car)
, depending upon where the method is located.