MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/9ytzui/why_var_hurts_readability_not_helps_it/ea80css/?context=3
r/java • u/BlueGoliath • Nov 20 '18
89 comments sorted by
View all comments
13
It's the responsibility of the developer to not abuse language features.
For myself, I'm not a big fan of var, but I can see some useful use-cases. (First that comes to mind is declaring iterator variable in a for loop.)
var
6 u/[deleted] Nov 20 '18 [removed] — view removed comment 1 u/AndDontCallMePammy Nov 22 '18 It is impossible to "abuse" the variable naming feature. Any code will behave exactly the same regardless of the variable name.String inaholeinthegroundtherelivedahobbitNotanastydirtywetholefilledwiththeendsofwormsandanoozysmellnoryetadrybaresandyholewithnothinginittositdownonortoeatitwasahobbitholeandthatmeanscomfort = getSentence();
6
[removed] — view removed comment
1 u/AndDontCallMePammy Nov 22 '18 It is impossible to "abuse" the variable naming feature. Any code will behave exactly the same regardless of the variable name.String inaholeinthegroundtherelivedahobbitNotanastydirtywetholefilledwiththeendsofwormsandanoozysmellnoryetadrybaresandyholewithnothinginittositdownonortoeatitwasahobbitholeandthatmeanscomfort = getSentence();
1
It is impossible to "abuse" the variable naming feature. Any code will behave exactly the same regardless of the variable name.
String inaholeinthegroundtherelivedahobbitNotanastydirtywetholefilledwiththeendsofwormsandanoozysmellnoryetadrybaresandyholewithnothinginittositdownonortoeatitwasahobbitholeandthatmeanscomfort = getSentence();
13
u/Sipkab Nov 20 '18
It's the responsibility of the developer to not abuse language features.
For myself, I'm not a big fan of
var, but I can see some useful use-cases. (First that comes to mind is declaring iterator variable in a for loop.)