6 ms·
TIL that Java 10 added local-variable type inference, to which I say, about damn time. I indeed decry having to type (and read) Foo<Bar> baz = new Foo<Bar>(),
by SloopJon 7y ago
TIL that Java 10 added local-variable type inference, to which I say, about damn time. I indeed decry having to type (and read) Foo<Bar> baz = new Foo<Bar>(), and no, Foo<Bar> baz = new Foo<>() isn't much better. I tested a project a couple of years ago using Java 8, and the contrast with the magical inferential powers of lambdas was stark.
Maybe it's because I've spent so much time in dynamically typed languages, but I see var/auto as absolutely essential to making static typing palatable. I'm a big fan of static typing, but I would be much less so if I had to do it without inference/deduction.
- java-man 7y agoyou obviously never refactored/debugged an old and massive code base written by people of various competency level...
- UIZealot 7y agoI just can't get over how dumb this is in Java: List<String> names = new List<String>(); Why not let people write just: List<String> names = new List(); Why did they even need to invent the diamond operator?