Notes on implementing concise calls to constructors with type parameters
Joseph D. Darcy
Joe.Darcy at Sun.COM
Fri May 15 14:01:02 PDT 2009
Rémi Forax wrote:
> Alex Buckley a écrit :
>> Rémi Forax wrote:
>>>> Is it conceivable to drop raw types and hence migration
>>>> compatibility? Sure. Is it an upgrade in behavior? Let's ask people
>>>> still on 1.4 who use raw types. They may have something to say about
>>>> the increased costs you'd impose on them when they try to upgrade
>>>> their codebase.
>>> First we talk about source compatibility, not binary one.
>> I'm not sure why you're bringing in binary compatibility.
> Just because I think that source compatibility is less important that
> binary compatibility.
> Or even worse, I think that sometime you have to create
> incompatibilities to teach user
> to not do things that are harmful.
Not all Java users are students or should be treated like students.
>> Someone on 1.4 (yes, or 1.3.1, very good) who wants to migrate to 1.7
>> for source feature X will be displeased to discover they can only get
>> as far as -source 1.6 because Remi cut an infinite number of raw types
>> out of 1.7.
> So they will update all the files that use raw types, discover some
> hidden bugs during the process,
> and if they have dependencies with a pre-1.5 libraries that was not
> generified since,
> they will create clean bridge code and only this code will be compiled
> with -source 1.6
> In the same time, Remi will be able to remove a two hours course that
> answer the following questions :
> what is a raw type ?
> where to use raw type ?
> where to not use them ?
> what are the rules when you inherits from a raw type,
> overrides a method that use raw type ?
> what is rare type ?
> why getClass()/.class produce raw type ?
> And replace it by a 10 minutes explanation on how to call legacy codes.
> I just hate raw types because they are hard to understand for average
Raw types were of course a compromise as part of bring generics to an
established language and its existing libraries.
Their use should be avoided in new code and the compiler should help
users in this regard.
More information about the coin-dev