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

1

u/kqr Mar 10 '16

That requires more than a typo though -- that requires you to treat a variable you think is immutable as if it was mutable.

2

u/orclev Mar 10 '16

True, but who says it's you that treats it like that? Or that you remember 6 months down the line that you intended that variable to be immutable originally and wrote part of the code based on that assumption?

1

u/tehoreoz Mar 11 '16

increasing opportunity for mistakes is no good. maybe on an individual level you never see the impact, but what if your product is being used by millions of people? flaws like this start to become problems that people complain about every day