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/yoden Mar 10 '16

Why? Does Visual Studio not have an equivalent to eclipse's "assign to new local variable"? It seems easier to write the LINQ query first and let the IDE handle the declaration.

1

u/Alikont Mar 10 '16
  1. Sometimes it's simply not possible, like if you use anonymous types.

  2. ILookup<string, IGrouping<int, Something>> v = GetSomething() is much uglier than var v = GetSomething().

0

u/[deleted] Mar 10 '16

Not that I'm aware of, no.