Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8FBBA3D12 for ; Wed, 4 May 2011 17:30:28 +0000 (UTC) Received: (qmail 88724 invoked by uid 500); 4 May 2011 17:30:28 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 88616 invoked by uid 500); 4 May 2011 17:30:28 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 88608 invoked by uid 99); 4 May 2011 17:30:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2011 17:30:27 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.214.171] (HELO mail-iw0-f171.google.com) (209.85.214.171) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2011 17:30:21 +0000 Received: by iwn8 with SMTP id 8so1328011iwn.30 for ; Wed, 04 May 2011 10:29:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.121.1 with SMTP id f1mr428590ibr.35.1304530197908; Wed, 04 May 2011 10:29:57 -0700 (PDT) Received: by 10.231.196.81 with HTTP; Wed, 4 May 2011 10:29:57 -0700 (PDT) In-Reply-To: References: Date: Wed, 4 May 2011 10:29:57 -0700 Message-ID: Subject: Re: [lang] Pair names still not right or consistent From: James Ring To: Commons Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hey, On Wed, May 4, 2011 at 9:58 AM, Gary Gregory wrote= : > Hi All: > > I think we still have naming problems with the Pair class reflected in th= is > Javadoc fragment: > > =A0* @param the first element type > =A0* @param 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. First and second is better, a Pair is an instance of a 2-tuple, which is an ordered list of elements. Left and right is no good IMO. > My preference is for K key and V value. > > 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 pai= r > of gloves; a pair of earrings. > (http://dictionary.reference.com/browse/pair) > > We clearly break this common sense definition. This is not the common definition in math and computer science. > Tuple is better, Association is better (if wordier.) > > Why is Pair a good name? A Pair is a 2-tuple, not a tuple. OrderedPair or TwoTuple might be more "accurate" names but I think Pair is very descriptive, short and sweet. > Writing Pair.of(lastName, address) reads ugly and wrong to me. It feels l= ike > I am writing a bug or using the API incorrectly. How does that sound wrong? I think it reads rather nicely. > The association, correspondence, tuple, whatever you call it, of these tw= o > values is just not a pair of anything. Anything but java.lang.Object... b= ut > that's not even true since null is not an Object. > > -- > Thank you, > Gary Regards, James --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org