views:

129

answers:

5

it seems a trivial point, until you realize that you need consistency. Not being a native English speaker, I prefer to ask both for grammar and for style. Which one must be preferred among these method names, returning a list of URIs, each one associated to an object?

objectUriList()
objectsUriList()
objectUrisList()
objectsUrisList()

Also, do you consider good style to make explicit that the returned object is a list in the method name. Maybe something like objectUris() (or its correct form) would be fine and intuitive in any case.

+2  A: 

objectUriList should be the correct answer. (Unless the function runs on more than one object and then objectsUriList would be preferable).

I like to specify the returned object in the function name but because this is how I worked for my entire life (ever since crappier programming languages). Nowadays, I believe it's not necessary.

Faruz
And look the first three answers agree!
Francis Upton
+2  A: 

I am not a native English speaker either. Correct form is either objectUriList or objectUris. Regardless of the number of objects and uris.

Car park = park of cars.
PC storage = storage of PCs.
oak forest
etc.

yu_sha
We all agree... !
Francis Upton
+1  A: 

I would call is objectUriList(), it's just easier to say and essentially correct. It's clear that it returns a List which is a set of Uris, so you don't really need the plural there.

However, your final suggestion of objectUris() is also good, depending on how easy it is to see that it returns a List in your IDE.

Francis Upton
Ok, not really programming related, but this means that in English you pluralize only the last of a set of chained names. I always forget this rule.
Stefano Borini
Being a native English speaker, I have no idea what the rules are, it just sounded right. :)
Francis Upton
Yup, I also go "by sound", but sometimes I have doubts... in particular because in Italian it's different, we pluralize everything.
Stefano Borini
+1  A: 

It's better to use ObjectUriList.

It is recommended in some circles not to include type names in member/parameter names, so you should drop the List part, but I find that "ObjectUriList" is much more explicit and meaningful than "ObjectUris", especially when you are likely to also have "ObjectUri" as a name nearby.

Jason Williams
+1  A: 

I would definitely go with the objectUris() alternative, omitting the "List" suffix. As you say, tidy and intuitive.

Anders Fjeldstad