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

5

u/[deleted] Mar 09 '16

Do you really write Java without an IDE though? Pretty much all of them support hovering over the variable to see its type.

1

u/kmaibba Mar 09 '16

No, I use an IDE, but as you say, you have to hover over it. I just think that the small benefit of not having to type as much (and usually you type only a few letters and then auto complete) does not outweigh the disadvantages. Again, I don't think that verbosity is a bad thing at all (within reason). Only a very small part of your time spent programming is actual typing.

2

u/[deleted] Mar 09 '16 edited Mar 09 '16

It hinders readability for me when the types are some convoluted generic thing to have it in the code. As long as I can see the type when I'm unsure, it's much easier to focus on the rest of the code.

I generally can't autocomplete much of Func<string, Func<SomeObject, List<SomeOtherObject>>> and I can tell from the code that that's what must be returned anyway.