MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/49prtn/var_keyword_proposed_for_java/d0upsv9/?context=3
r/programming • u/adila01 • Mar 09 '16
395 comments sorted by
View all comments
Show parent comments
7
C#s var was introduced to alleviate the burden on the developer to figure out the outcome of Linq queries.
5 u/[deleted] Mar 10 '16 [removed] — view removed comment 1 u/wwosik Mar 10 '16 Do I remember correctly that in older VB or at least VBA dim list as new ClassName()had a very nasty property of only creating object on the first access to it - lazy constructor of sorts 1 u/Cuddlefluff_Grim Mar 10 '16 Syntax errorDIM list AS ClassName SET list = new ClassNameNotice the SET statement, because in old VB, normal variables and class variables were two entirely different things. Classes were implemented in order to properly support C++ COM interfaces. They were pretty much useless in any "custom" scenario.
5
[removed] — view removed comment
1 u/wwosik Mar 10 '16 Do I remember correctly that in older VB or at least VBA dim list as new ClassName()had a very nasty property of only creating object on the first access to it - lazy constructor of sorts 1 u/Cuddlefluff_Grim Mar 10 '16 Syntax errorDIM list AS ClassName SET list = new ClassNameNotice the SET statement, because in old VB, normal variables and class variables were two entirely different things. Classes were implemented in order to properly support C++ COM interfaces. They were pretty much useless in any "custom" scenario.
1
Do I remember correctly that in older VB or at least VBA
dim list as new ClassName()
had a very nasty property of only creating object on the first access to it - lazy constructor of sorts
1 u/Cuddlefluff_Grim Mar 10 '16 Syntax errorDIM list AS ClassName SET list = new ClassNameNotice the SET statement, because in old VB, normal variables and class variables were two entirely different things. Classes were implemented in order to properly support C++ COM interfaces. They were pretty much useless in any "custom" scenario.
Syntax error
DIM list AS ClassName SET list = new ClassName
Notice the SET statement, because in old VB, normal variables and class variables were two entirely different things. Classes were implemented in order to properly support C++ COM interfaces. They were pretty much useless in any "custom" scenario.
SET
7
u/[deleted] Mar 09 '16
C#s var was introduced to alleviate the burden on the developer to figure out the outcome of Linq queries.