My earlier post was made in rather a fey mood :
Actually, I really like Generics. The lack of C++ style templates has always left me uncomfortable when using Collections. I keep (kept?) agonising on whether to cast everytime I extracted something from a Collection, or whether to create a class, inherited from the relevant collection, but with the cast built in. The latter has more overhead, but better compile time checking. This I’m really pleased to see Generics, because it catches miscasting at compile time, but without runtime penalty. Many thanks to the Sun team
However, I don’t feel the same way about autoboxing. Ok, this means I can put basic types in & out of Collections without manually encapsulating them in a class, which is nice. But, as has been said earlier, these are not ‘free’ operations. It probably doesn’t matter if code performance isn’t an issue. I guess, it’s more of an issue when games programming, as it would be easy to overlook inadvertant use of autoboxing in a tight loop, which could slow things down and produce lots of garbage. It disguises cases where it would be better to declare things as Integer, Float etc. throughout. Really, this is an aid to sloppy programming. I prefer to type in a few extra characters, so that the compiler knows I really wanted those encapsulations.
Since it is possible to have more then one JRE installed at a time, I think it should be possible to phase out depreciated methods over (say) 3 to 5 years. However this does raise the issue of how long maintenance releases of earlier JREs should continue to be made available. So phasing out depreciated methods is not really free. However if it isn’t done, the language begins to suffer API bloat, so I’m largely in favour.
Alan.