3 ms·
I'm in the "do" camp, because using "get" (or similar verbs) offers a hint that the method does not mutate the object. "Average" can be both a noun and a verb,
by Terr_ 10y ago
I'm in the "do" camp, because using "get" (or similar verbs) offers a hint that the method does not mutate the object.
"Average" can be both a noun and a verb, so "getAverage()" clarifies that it's being used as a noun.
An alternate but less-common approach would be to assume verbs and conjugate, like "averaged()"... But what if the verb and noun have very different meanings?