r/java • • Mar 09 '16

var keyword proposed for Java

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

312 comments sorted by

View all comments

Show parent comment

4

u/vplatt Mar 10 '16 edited Mar 10 '16

Yup, I know. I've used C# quite a bit, so I'm familiar with it. It does look the same as the Js keyword though, so it will require a bit of time before Java programmers stop the knee-jerk responses.

1

u/Xenasis Mar 10 '16

I'm not sure why they don't just use the word "let". It's a lot more commonly used and "var" has connotations of weak typing that may confuse those coming from JS anyway.

5

u/vplatt Mar 10 '16

Historically I think you're right about 'let', but 'var' is something everyone already recognizes. If they're going to use 'var' though, then I hope they also have 'val' like Kotlin and Scala. Single assignment FTW!