Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grammatically correct double-noun identifiers, plural versions

Tags:

Consider compounds of two nouns, which in natural English would most often appear in the form "noun of noun", e.g. "direction of light", "output of a filter". When programming, we usually write "LightDirection" and "FilterOutput".

Now, I have a problem with plural nouns. There are two cases:

1) singular of plural

e.g. "union of (two) sets", "intersection of (two) segments"

Which is correct, SetUnion and SegmentIntersection or SetsUnion and SegmentsIntersection?

2) plural of plural

There are two subcases:

(a) Many elements, each having many related elements, e.g. "outputs of filters"

(b) Many elements, each having single related element, e.g. "directions of vectors"

Shall I use FilterOutputs and VectorDirections or FiltersOutputs and VectorsDirections?

I suspect correct is the first version (FilterOutupts, VectorDirections), but I think it may lead to ambiguities, e.g.

  • FilterOutputs - many outputs of a single filter or many outputs of many filters?
  • LineSegmentProjections - projections of many segments or many projections of a single segment?

What are the general rules, I should follow?

like image 369
Michal Czardybon Avatar asked May 05 '10 13:05

Michal Czardybon


People also ask

How do you pluralize two nouns?

Compound nouns normally form the plural by adding -s to the last word of the compound. There are a few exceptions:A compound noun formed from a noun and an adverb makes the first word plural. Compound nouns with woman as the first word make both words plural.

How would you identify a noun that is plural?

A noun is plural when it represents two or more people, places, things, or ideas. You can identify most plural nouns because they end in –s or –es, although there are plenty of exceptions. In particular, irregular plural nouns each have their own special plural forms, such as child and its plural form, children.


2 Answers

There's a grammatical misunderstanding lying behind this question. When we turn a phrase of form:

1. X of Y

into

2. Y X

the Y changes grammatical role from a noun in the possessive (1) to an adjective in the attributive (2). So while one may pluralise both X and Y in (1), one may only pluralise X in (2), because Y in (2) is an adjective, and adjectives do not have grammatical number.

Hence, e.g., SetsUnion is not in accordance with English. You're free to use it if it suits you, but you are courting unreadability, and I advise against it.

Postscript

In particular, consider two other possessive constructions, first the old-fashioned construction using the possessive pronoun "its", singular:

3a. Y, its X

the equivalent plural:

4a. Ys, their X

and their contractions, with 4b much less common than 3b:

3b. Y's X 4b. Ys' X

Here, SetsUnion suggests it is a rendering of the singular possessive type (3) Set's Union (=Set, its Union), where you intended to communicate the plural possessive (4) Sets, their Union (contracted to the less common Sets' Union).

So it's actively misleading.

like image 77
Charles Stewart Avatar answered Nov 14 '22 19:11

Charles Stewart


Unless you're getting hamstrung by a convention driven system (ruby on rails, cakePHP etc), why not use OutputsOfFilters, UnionOfSets etc? They may not be conventional but they may be clearer.

For example its pretty clear that ProjectionOfLineSegments and ProjectionsOfLineSegment are different things or even ProjectionsOfLineSegments....

like image 41
Michael Anderson Avatar answered Nov 14 '22 19:11

Michael Anderson