Re: Why Generics?
- From: "Chris Uppal" <chris.uppal@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 6 May 2005 09:26:41 +0100
Mike Schilling wrote:
> [me:]
> > Funny thing, I know you intended this as sarcasm, but I agree with it as
> > written. Well. not quite literally -- I don't suppose there's any
> > conspiracy -- but I do think that generics have been introduced out of
> > ill-considered, or unconsidered, C++-envy.
>
> Why C++, in particular?
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.
> The next version of C# has generics, and the
> current one has auto-boxing, variable-length argument lists, for-loops
> over collections, etc. Given that Java competes for mindshare with .NET,
> I think competition with C# is a more likely motive for the 1.5 changes.
I agree that C# provides competition and a source of ideas (both good and
bad). I don't doubt for a minute that Java's auto-boxing etc, have been added
more in imitation of C# than convergently with it.
BTW, do you know of a description (readable, rather than a formal spec) of the
semantics/implementation of C#''s generics ? I gather that it's being done at
the VM level rather than by compiler kludgery. If so then it may be that C#''s
generics are less problematic than Java's.
-- chris
.
- Follow-Ups:
- Re: Why Generics?
- From: Dale King
- Re: Why Generics?
- From: David Blickstein
- Re: Why Generics?
- From: Mike Schilling
- Re: Why Generics?
- References:
- Why Generics?
- From: David Blickstein
- Re: Why Generics?
- From: Eric Sosman
- Re: Why Generics?
- From: Chris Uppal
- Re: Why Generics?
- From: Mike Schilling
- Why Generics?
- Prev by Date: Re: Checked and unchecked exceptions. A clearer explanation please.
- Next by Date: reload rotated image
- Previous by thread: Re: Why Generics?
- Next by thread: Re: Why Generics?
- Index(es):