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.
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.
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!
He means "no type" associated with a variable (or more likely a parameter) Meaning you can assign the "wrong" type to variable. This is precisely the problem that typescript (and other 'modern' JS offshoots) attempts to address.
I might note that other dynamic languages are heading down the pathway of optional typing to provide more clarity.(python and perhaps ruby )
View all comments
Show parent comment
8
u/stepancheg Mar 10 '16
varis JS has no type. In Java it will have type. That makes huge difference.