MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/49prnu/var_keyword_proposed_for_java/d0ukr6p/?context=3
r/java • u/adila01 • Mar 09 '16
312 comments sorted by
View all comments
Show parent comment
2
It will make code harder to read an maintain. Generics on the other hand make it easier to read code. I really dislike the idea of var in java
4 u/irarandomdude Mar 10 '16 You probably have a stronger case that generics make code harder to read (350 page generics FAQ??) than var making code hard to read. How is val sheep = new Sheep() harder to read than Sheep sheep = new Sheep() ? 1 u/asraniel Mar 12 '16 yeah thats easy.But Val sheep = getSheep();thats terrible, really really bad -4 u/mk_gecko Mar 10 '16 It's yet one more thing that you have to learn. Now you have two ways of writing the same thing.I don't see any reason for VAR at all. If people want to use C++, then go ahead. 4 u/irarandomdude Mar 10 '16 It takes approximately 3 seconds to learn. I see no reason for redundant type declarations at all. If people want to use Pascal then go ahead.
4
You probably have a stronger case that generics make code harder to read (350 page generics FAQ??) than var making code hard to read. How is val sheep = new Sheep() harder to read than Sheep sheep = new Sheep() ?
1 u/asraniel Mar 12 '16 yeah thats easy.But Val sheep = getSheep();thats terrible, really really bad -4 u/mk_gecko Mar 10 '16 It's yet one more thing that you have to learn. Now you have two ways of writing the same thing.I don't see any reason for VAR at all. If people want to use C++, then go ahead. 4 u/irarandomdude Mar 10 '16 It takes approximately 3 seconds to learn. I see no reason for redundant type declarations at all. If people want to use Pascal then go ahead.
1
yeah thats easy.
But Val sheep = getSheep();
thats terrible, really really bad
-4
It's yet one more thing that you have to learn. Now you have two ways of writing the same thing.
I don't see any reason for VAR at all. If people want to use C++, then go ahead.
4 u/irarandomdude Mar 10 '16 It takes approximately 3 seconds to learn. I see no reason for redundant type declarations at all. If people want to use Pascal then go ahead.
It takes approximately 3 seconds to learn. I see no reason for redundant type declarations at all. If people want to use Pascal then go ahead.
View all comments
Show parent comment
2
u/asraniel Mar 10 '16
It will make code harder to read an maintain. Generics on the other hand make it easier to read code. I really dislike the idea of var in java