|
|
|
|
|
by jameskilton
5804 days ago
|
|
You're confusing readability with capability. Yes without Generics trying to build such a collection in Java is insanely verbose and yes very hard to follow, but with generics, while it's less code to write to build the collection you do hit a mental Yield when you try to read that line: "Ok, this is a Map, it keys on Integers to ... another Map, that keys on Integers and points to Doubles. Ok got it, lets continue" Of course when you actually go to use this collection, you don't benefit that much (off the top of my head): Map<Integer,Map<Integer,Double>> = myEntry;
myEntry.set(5, new Map<Integer, Double>(10, 30.0));
Map<Integer, Double> entry = myMap.get(5);
... etc You are constantly having to restate the types and the generics. It's this constant repetition and "compiler pleasing" that the author is complaining about. |
|