DEV Community

Discussion on: How to use the var keyword in Java? Example Tutorial

Collapse
 
milan997 profile image
milan997

Haven't really understood it in Java or C#, I don't understand the gains except for not having to type a few characters, and you're loosing that nice readability in statically typed languages.

Also, var should be illegal now in javascript, having let and const.

Collapse
 
javinpaul profile image
javinpaul

It's not just typing but readability improves with more concise code but yes, you got to be more careful with variable names now because you just have one identifier to use to convey your intention and what the variable is and what it does.