-
-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of singular/plurals for compound terms #51
Comments
Hi, @octavian-nita. Thank you for this suggestion! I think you've formulated it beautifully. Would this also apply to cases when multiple segments of the variable are changed to plurals while only the last (?) bit should be plural? -postsLinks
+postLinks |
Hi @kettanaito, Indeed, I would say so, yes. 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: