|
|
|
|
|
by photosinensis
3949 days ago
|
|
It still comes up quite often. Autoboxing and type erasure are two of the biggest mistakes that have been inflicted upon the Java language after its original release. Not knowing about them will lead to a world of hurt. They should have killed the primitive/object distinction, turning the primitives into stack-allocated objects and rewritten the collections libraries. But no, syntactic sugar is better than actually fixing the problem for those that want a fix. |
|
That would have been a mistake, because it would have made Java unreasonably inefficient for manipulating large data sets. You really need both, which is why they included both originally.
Autoboxing is a problem in that it allows you to pretend you don't have to check for nulls when you really should be checking for nulls. If I had my druthers I'd forbid autoboxing on my projects.