Dec 04
You know something is wrong when the good solution looks like:
TypeReference<List<Integer>>() {}
See:
- Super Type Tokens: Bob Lee
- Super Type Tokens: Neal Gafter
- Java Generics Issue for Ted Neward
You know something is wrong when the good solution looks like:
TypeReference<List<Integer>>() {}
See:
My posts, status updates, link blog, and anything else I do on the web is here:
I am honoured to be working with my long time friend and collaborator Ben Galbraith on helping to set the direction of the industry.
December 4th, 2006 at 8:19 pm
The alternative is that generic code wouldn’t be able to interact with legacy code. Erasure isn’t *that* bad.
December 4th, 2006 at 8:32 pm
I am somewhat teasing, but on the other hand I would hate to be in CSCI 101 and staring at this kind of code. (lisp (prefer (i would)))
December 4th, 2006 at 9:16 pm
I particularly like what Neal himself said about that: “Erasure rears its ugly head…”. He was joking, but still… :-)
December 4th, 2006 at 10:50 pm
The current syntax leaves a lot to be desired, but that’s what syntax sugar is for–so CS 101 students can enjoy the semantics without worrying about the mechanics. ;)
December 5th, 2006 at 12:19 am
“Player friend:come here to experience the pouring , thrilling and lightsome
online game, please register the following website ,they will provide the high-
speed game agency to every player, the speed and service must be the top-grade
absolutely .”
game
December 5th, 2006 at 4:03 am
Something’s been wrong for quite a while.
Stephen Colebourne bashed his head against the wall too: http://jroller.com/page/scolebourne?entry=generics_bashing_your_head_against
When everybody needed more expressive ways to write behaviour, they gave us a way to play hide-and-seek with the compiler. It hides, you seek.
December 5th, 2006 at 7:16 am
Or when you cannot do this :
List<Stuff> a= new ArrayList<Stuff>();
List<Stuff> b= new ArrayList<Stuff>();
List<Stuff> c= new ArrayList<Stuff>();
List<Stuff>[] aLotOfStuff= new List<Stuff>[]{a, b, c};
But you can do :
List<?>[] aLotOfStuff= new List<?>[]{a, b, c};