Re: MV Keys

From: Marshall Spight <marshall.spight_at_gmail.com>
Date: 7 Mar 2006 07:25:26 -0800
Message-ID: <1141745126.607789.210170_at_p10g2000cwp.googlegroups.com>


Jon Heggland wrote:

>

> Can you give any examples? Is this a problem with Java's Collection, Set
> and List?

I recently went to a talk by Joshua Bloch and Neal Gafter in which they describe ways to confuse yourself with Java. "Java puzzlers" they call it; it was quite interesting. They have a companion book as well.

One of the puzzlers involved the fact that a method for getting the set of methods in a class returned a List, even though it returned the (distinct) elements of that list in arbitrary order, and they had some code from the field that didn't work because of this.

The set of methods in a class ought to be represented by a Set. But customarily everyone uses List for most everything, even when the data is not ordered.

Okay, that's a kind of weak example; I need a better one.

Marshall Received on Tue Mar 07 2006 - 16:25:26 CET

Original text of this message