Re: Why Generics?
- From: "Mike Schilling" <mscottschilling@xxxxxxxxxxx>
- Date: Fri, 06 May 2005 19:26:03 GMT
"David Blickstein" <db@xxxxxx> wrote in message
news:oMOee.5020$Eq1.1426@xxxxxxxxxxxxxxxxxxx
>> My reason is simply that people have been discussing adding "templates"
>> to
> Java
>> since well before C# was invented (or at least publicly admitted to).
> Same
>> goes for enums.
>
> Enums were truly needed. They eliminated a class of (what I consider to
> be)
> type-related errors that in my experience was very common: using the wrong
> constant in the wrong context. Like substituting LAYOUT.LEFT_JUSTIFIED
> for LAYOUT.WEST in a layout manager.
>
> There's a C# feature that I also think is desperately needed in Java.
>
> C# allows you to use the SAME syntax for fields and nyladic (zero
> arguments)
> methods. This allows you to abstract the implementation of the field so
> that fields can be re-implemented as methods without breaking existing
> code.
A syntax change doesn't help much here. Unless the bytecode is also changed
to make field references and zero-argument method calls identical, a change
will cause incompatibility with existing binaries.
.
- References:
- Why Generics?
- From: David Blickstein
- Re: Why Generics?
- From: Eric Sosman
- Re: Why Generics?
- From: Chris Uppal
- Re: Why Generics?
- From: Mike Schilling
- Re: Why Generics?
- From: Chris Uppal
- Re: Why Generics?
- From: David Blickstein
- Why Generics?
- Prev by Date: Re: Application slow, slow then hang
- Next by Date: Re: Extreamly large Hashtable
- Previous by thread: Re: Why Generics?
- Next by thread: Re: Why Generics?
- Index(es):
Relevant Pages
|
Loading