Notes on implementing concise calls to constructors with type parameters
forax at univ-mlv.fr
Fri May 15 16:06:12 PDT 2009
Joseph D. Darcy a écrit :
> 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.
I don't agree, Java is complex enough to write tons of puzzlers
(there are even books about Java puzzlers :)
That kind of languages should educate/help their users.
But you are right, some users don't want to learn, they are the ones
that doesn't want that the language changes.
>>> 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.
Yes, but raw types are only necessary to cross the bridge between pre
and post generics world.
Raw types already exist in 1.5, 1.6 and 1.7. So there is no need to have
raw types in 1.8 because if I want
that kind of bridge I can compile that specific part of the code with
> Their use should be avoided in new code and the compiler should help
> users in this regard.
That's not true for javac. Current version doesn't, by default, emit a
warning If you use raw types.
But your are right that eclipse do that since, I think, at least two years.
More information about the coin-dev