begin  quoting Christopher Smith as of Mon, Jun 11, 2007 at 04:34:08AM -0700:
> Somewhere long ago I bookmarked this page:
> 
> http://www.cs.arizona.edu/projects/sumatra/hallofshame/

Hm...

> Amazingly, it is still up. Anyway, they have a couple of examples of 
> "surprising" behavior in the Java language specification itself. It is 
> all entirely logical, but also entirely in violation of the principle of 

Finalizer methods are so obnoxious that most folks didn't bother to use
'em at all.  They do in fact violate the principle of least suprise,
and they're one of Java's warts.

Finally blocks are tricky but not suprising.

try {
   return 1;
} finally {
   return 2;
}

Is _not_ "suprising", as compared to List<Object> and List<String>.

> least surprise. So you see, this kind of thing is part of Java's 
> heritage (and really, it is VERY difficult for programming languages to 
> avoid this sort of thing, as they are, by nature logical constructs).

Oh, indeed, it's a very tricky thing, and it's very difficult. That just
underscores how important it is to minimize this sort of thing.  Sometimes
you can't avoid it, sometimes you can.

-- 
Languages should help you manage complexity, not introduce it.
Stewart Stremler

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to