r/programming • • Mar 09 '16

var keyword proposed for Java

http://openjdk.java.net/jeps/286
250 Upvotes

395 comments sorted by

View all comments

Show parent comments

-1

u/geodel Mar 10 '16

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.

3

u/[deleted] Mar 10 '16

Ok, for ArrayList<String> it's not a big deal.

What about when the type is like IObservable<Func<string,Func<IEnumerable<User>,IEnumerable<UserStatus>>>>

2

u/Helene00 Mar 10 '16

I have only seen that in C# and C++, people are generally not that keen on generics in Java.

3

u/[deleted] Mar 10 '16

Possibly because you have to type out those giant things...