Archive for November, 2006

Java Book: Generics and Collections

Java Generics and Collections by Maurice Naftalin and Philip Wadler seems to be a very fine introduction to Java generics with emphasis on the Collection classes.

One of the things I never really got about generics is the correct use of super wildcards. While I found extends wildcards to be rather easy to grasp, super wildcards always managed to confuse me. In chapter 2, I found the first definition I immediately understood:

The Get and Put Principle. Use an extends wildcard when you only get values out of a structure, use a super wildcard when you only put values into a structure, and don’t use a wildcard when you both get and put.

Combined with the trivial Collection-based example given in the book I find this definition very helpful and easy to remember.

The final draft is was available for free.

Leave a Comment

Another year passed…

…and according to The Lifeclock, I’m likely to die on the 11th of May, 2056. That’s just another 50 years! I’d be 77 by then. On the other hand, BBC’s life expectancy calculator thinks I’ll die at the age of 88.8, so that would be another whopping 62 years to go.

A pretty nice geek present was the C64-on-a-stick my brother gave to me. It’s a single-chip implementation of the C64 home computer and it includes 30 games including Summer Games and Winter Games. It is interesting to see where computer gaming was just 20 years ago, back when a single person could develop a groundbreaking game…

Leave a Comment

Nerdy Book In-Jokes

Tal Cohen maintains a great list of book in-jokes found in maths and computer publications. My favourite one is this index entry of The Java Programming Language:

In the index, we find (p. 579):

IndexOutOfBoundsException: 30, 196, 210, 596

The book is only 595 pages long.

Found via reddit.

Comments (1)