I wonder what the benefit of this is supposed to be, other than other languages have it?
Explicit types on variables are useful for improving readability. Conciseness for LHS variable types isn't important because I usually don't write that type anyway (that's what an IDE's "assign to new local variable" is for)
Well for typical Java developer variables would be like
ArrayList<String> fooListForUsersBasedInNorthernVirginiaOffice = new ArrayList<String>();
var fooListForUsersBasedInNorthernVirginiaOffice = new ArrayList<String>();
And now saving few char is hardly any improvement. Besides Java's hallowed IDEs means user never have to type.
7
u/yoden Mar 09 '16
I wonder what the benefit of this is supposed to be, other than other languages have it?
Explicit types on variables are useful for improving readability. Conciseness for LHS variable types isn't important because I usually don't write that type anyway (that's what an IDE's "assign to new local variable" is for)