On 4 May 2011 17:58, Gary Gregory <garydgreg...@gmail.com> wrote: > I think we still have naming problems with the Pair class reflected in this > Javadoc fragment: > > * @param <L> the first element type > * @param <R> the second element type > > Either we call them L left and R right, or we call them F first and S > second, but mixing both is not good IMO. > > My preference is for K key and V value.
Key and value implies a relationship between the two parts of the pair (the key somehow describes the value), which we cannot do (implementing Map.Entry is for convenience, not for any other reason). Either first/second or left/right are valid choices. At OpenGamma we use first/second but are able to change to left/right if this class is released. > I still do not like Pair as a name because a pair is: two identical, > similar, or corresponding things that are matched for use together: a pair > of gloves; a pair of earrings. > (http://dictionary.reference.com/browse/pair) > > We clearly break this common sense definition. I understand that from an English language POV, but Java devs all over know this as a pair. No other name will do I'm afraid. Stephen --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org