Grammatically correct double-noun identifiers, plural versions

Posted by Michal Czardybon on Stack Overflow See other posts from Stack Overflow or by Michal Czardybon
Published on 2010-05-05T13:15:22Z Indexed on 2010/05/05 13:18 UTC
Read the original article Hit count: 188

Filed under:
|

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"

Shell 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?

© Stack Overflow or respective owner

Related posts about naming-conventions

Related posts about english