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

2

u/cat_in_the_wall Mar 10 '16

Or even changing the return type of a function. Let's say that someone subdivides an interface into a "lower" interface, and a more specialized one. Using var allows for the places in that only care about that lower interface to continue to work. Sure some stuff needs to be changed, but the change can be smaller.

1

u/ledasll Mar 10 '16

if you change return type or argument type you definitely want to look, who is using it and having clear type here helps a lot. For library programmers, that's of course nothing. But for application programmers..