A fellow acquaintance, Yuen Chi, has asked an interesting question - How Generic Shall it Be? He is talking of Java’s Generics introduced in JDK5. I understand that Generics was introduced for the sole purpose of clearer code, allowing compile-time checking of object types in Collections. The compiler now has an opportunity of detecting errors if a misinformed programmer inserts a wrong type into the Collection, instead of having a ClassCastException blowing up in your face at runtime. This is all fine and noble except that I’ve seen pretty hairy codes because of Generics.

Personally, I don’t really get it yet. And since I’m doing quite well at this level of understanding, I wonder if it’s really worth my time to go through a thorough study on Generics.

If you’re a Java programmer, I would like to hear your opinion on this matter. It would be even better if you can share the answer to the 64K MB question - why bother?