4 ms·
Do you really think something like this: Dictionary<string, Tuple<int, List<string>>> foo = new Dictionary<string, Tuple<int, List<string>>>(); Is prefferable
by m_fayer 10y ago
Do you really think something like this:
Dictionary<string, Tuple<int, List<string>>> foo = new Dictionary<string, Tuple<int, List<string>>>();
Is prefferable to:
var foo = new Dictionary<string, Tuple<int, List<string>>>();
What do you get from the former that makes the eye-pain worth it?
Also, the var keyword is necessary for anonymous types if you want to hold a reference to one. And this is a language feature I sorely miss in Java-land.
- dbdr 10y agoSince Java 7 you can use the "diamond operator" in such cases: Dictionary<string, Tuple<int, List<string>>> foo = new Dictionary<>();