News for hackers. Stuff that matters.
Re:Java autoboxing/unboxing madness (2007) by mcculley on Thursday September 03, 2015 @01:26PM (#10166260)
In general, it is good. But when combined with generics, weird stuff happens. Say you have some generic collection of Integer (e.g., Map<Integer, String>) and you retrieve some autoboxed value that was coerced into a Long and you try to use that as a key. You might get a null result where you would expect otherwise. It makes you want to pull your hair out and undermines the confidence that type safety gives you in general.

Autoboxing and generics are clearly bolted onto Java and it would be designed differently if they were there in the beginning. This makes me doubtful when Go adherents say that they can just add generics later.

There are no comments on this comment yet.