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 comments

18

u/marc2912 Mar 09 '16

It's not a matter of don't use it since most developers don't just work with their code. Then you get the inconsistency that it's in some places and not in other.

0

u/lelarentaka Mar 09 '16

The language doesn't define the number of spaces to use for indentation, or where to put an opening curly, or which case to use for naming methods. Turns out we have some great inventions to keep our codebase pretty and consistent. I'll let you take a guess on what those are

1

u/kyle2143 Mar 09 '16

Oh, so there's tools to retype var keywords into keywords that actually describe the data type?

3

u/lelarentaka Mar 10 '16

Not yet obviously, but the same static analyser that puts wiggly red line under "String s = new ArrayList()" can absolutely do what you want there.