You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd suggest a convention regarding the use of singular/plurals if only I knew how to formulate it in English properly :) Hopefully, someone has a good English formulation to replace mine.
The idea is to pay attention to what noun in a (more-or-less) compound term we employ in plural form when naming things with multiple values. I.e., just as we use, say, documentTypes, I think we should most probably use childPaths instead of childrenPaths, etc.
I've seen this (i.e., using the plural form for all nouns in such composed term) happening a lot and I don't quite agree with it.
The text was updated successfully, but these errors were encountered:
octavian-nita
added a commit
to octavian-nita/naming-cheatsheet
that referenced
this issue
Mar 5, 2021
There may be situations where keeping several plurals might make sense, depending on what the developer wants to convey. In your example, I would understand "postLinks" as referring to the collection of links of a particular post, but someone else could use "postsLinks" to refer, for example, to all the links of all the posts. However, I would still not use "postsLinks" for that :). Instead, I would probably use "allPostLinks" or something else. Or another example would be when we have a map/dictionary that associates many entities, like posts and their links. There, we might use "postsLinks" for brevity, but I'd still make an effort to write "postsToLinks" or "postsAndLinks."
So yes, I generally favor only one word/segment in the plural form, and I'd recommend much care with several words in plural.
I'd suggest a convention regarding the use of singular/plurals if only I knew how to formulate it in English properly :) Hopefully, someone has a good English formulation to replace mine.
The idea is to pay attention to what noun in a (more-or-less) compound term we employ in plural form when naming things with multiple values. I.e., just as we use, say,
documentTypes
, I think we should most probably usechildPaths
instead ofchildrenPaths
, etc.I've seen this (i.e., using the plural form for all nouns in such composed term) happening a lot and I don't quite agree with it.
The text was updated successfully, but these errors were encountered: