On Mon, Aug 31, 2009 at 1:04 PM, Mike Samuel<[email protected]> wrote:
>
> Would people like to use a library like
> http://code.google.com/p/google-collections/ to make code more terse.
> It provides a number of utility classes that make good use of java
> generic type inference.
> So instead of
>     Map<KeyTypeName, ValueTypeName> myMap = new HashMap<KeyTypeName,
> ValueTypeName>();
> you can write
>     Map<KeyTypeName, ValueTypeName> myMap = Maps.newHashMap();
> without warnings and without losing type checking.

I would like to see us move our Java code towards being Joe-E
compliant. If the existing Joe-E collection primitives and the
collections that have been built on these are inadequate, we should
expand and contribute to Joe-E until we have something that's both
safe and adequate.

<rant>
As for the Java 1.5 generic type notation, many of you have heard me
say this verbally, but for the record: They're more trouble than
they're worth. Without type erasure (as in C# generics), I could at
least imagine myself arguing both sides. But with type erasure they
accomplish exactly the opposite of their claimed purpose: They make
code less reliable. In a pure Java 1.4 program, I knew that a
ClassCastException could only be thrown where a cast operator appeared
in my code. Starting with Java 1.5, the origin of ClassCastExceptions
no longer has any obvious correspondence with the notation of the
source code.
</rant>

Joe-E addresses a real safety problem. Java generics fail to address a
safety problem that's mostly pointless anyway. Let's not travel
further from supporting good safety for the sake of failing to support
bad safety more efficiently.

-- 
    Cheers,
    --MarkM

Reply via email to