hisassy / google-collections

Automatically exported from code.google.com/p/google-collections
Apache License 2.0
0 stars 0 forks source link

Naming issue with Multiset.count(Object) #264

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The name 'count' is inconsistent on several, erm, counts.

First, the related method in Multiset.Entry is called 'getCount'. (True, 
'getCount' and 'getElement' here could be renamed 'count' and 'element' to 
fix this problem, but we wanted Multiset.Entry to resemble Map.Entry. And 
it doesn't address the next issue, anyway.)

Second, we have always intended to follow Josh's rule that it's good to 
omit the "get-" prefix except when methods happen to come in setter/getter 
pairs. And here, we do indeed have 'setCount' methods.  So 'setCount/count' 
don't have the nice parallel structure that 'setCount/getCount' would.

Is it worth renaming Multiset.count() to Multiset.getCount() at this point 
in the game?  Or would this be too disruptive?  I did promise that we would 
try to only rename APIs through a deprecation process starting with 1.0-
rc1, but that doesn't work for an interface method.

I can go either way on this, in fact I lean toward doing nothing, because 
after all, no one's exactly complained about this in three years. Just 
putting it out there. Whatever name we use we're stuck with forever.

Original issue reported on code.google.com by kevin...@gmail.com on 16 Oct 2009 at 10:31

GoogleCodeExporter commented 8 years ago
Time to declare this one a mistake that will live on in perpetuity.

Original comment by kevin...@gmail.com on 29 Oct 2009 at 7:00