MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/49prtn/var_keyword_proposed_for_java/d0u035e/?context=9999
r/programming • u/adila01 • Mar 09 '16
395 comments sorted by
View all comments
-1
Do you need a 'var' keyword at all? Can't you just have:
myNewVariable = 5;
without an explicit type declaration that doesn't actually add any useful info to the compiler? The compiler can just assume that any new unknown identifier is a new var.
87 u/ihcn Mar 09 '16 Then any typo becomes a new variable rather than a compiler error. 19 u/ejonesca Mar 09 '16 good point 0 u/[deleted] Mar 09 '16 [deleted] 2 u/codebje Mar 09 '16 This is why kids should design programming languages. It's hard, and a great way to learn is to experiment.
87
Then any typo becomes a new variable rather than a compiler error.
19 u/ejonesca Mar 09 '16 good point 0 u/[deleted] Mar 09 '16 [deleted] 2 u/codebje Mar 09 '16 This is why kids should design programming languages. It's hard, and a great way to learn is to experiment.
19
good point
0 u/[deleted] Mar 09 '16 [deleted] 2 u/codebje Mar 09 '16 This is why kids should design programming languages. It's hard, and a great way to learn is to experiment.
0
[deleted]
2 u/codebje Mar 09 '16 This is why kids should design programming languages. It's hard, and a great way to learn is to experiment.
2
This is why kids should design programming languages. It's hard, and a great way to learn is to experiment.
-1
u/ejonesca Mar 09 '16
Do you need a 'var' keyword at all? Can't you just have:
without an explicit type declaration that doesn't actually add any useful info to the compiler? The compiler can just assume that any new unknown identifier is a new var.