ACMNexus / google-collections

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

Naming com.google.common.collect.Collections2 #131

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The JavaDoc for the static utility class
com.google.common.collect.Collections2 does not provide any hints to why
"2" was added to the otherwise intuitive "Collections" name, thus breaking
the convention defined by java.util.Collections,
com.google.common.collect.Iterables, com.google.common.collect.Iterables
(and others).

I'm sure there must be a good reason, but it should be made evident from
the JavaDoc.

Original issue reported on code.google.com by morten.h...@gmail.com on 13 Mar 2009 at 11:32

GoogleCodeExporter commented 8 years ago
Explaining why a name was chosen isn't the kind of information that belongs in
Javadoc. It belongs in the FAQ
(http://code.google.com/p/google-collections/wiki/Faq), and you can see several
examples of it there.

However, in this case, this one strikes me as a RAQ (rarely asked question), 
not a
FAQ.  I think most people are familiar with how annoying it is to need to use 
two
classes with the same simple name from different packages; one of them must 
always be
fully-qualified.  Worse, since java.util.Collections will always and forever be 
by
far the most useful, we'd have caused a lot of grief by making everyone who 
types
Collections suddenly get an IDE pop-up menu asking them which one they mean.

I could paste all this into the FAQ but I think we have many other questions to
answer that will puzzle many more people than this one.

Original comment by kevin...@gmail.com on 13 Mar 2009 at 3:32