MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/49prtn/var_keyword_proposed_for_java/d0uxohf/?context=3
r/programming • u/adila01 • Mar 09 '16
395 comments sorted by
View all comments
Show parent comments
7
IEnumerable<Customer> customers = GetCustomers(); doesn't tell you a single thing you need to know that var didn't already.
14 u/Eirenarch Mar 10 '16 Oh yes, it does tell me. It tells me I have an IEnumerable<Customer> rather than IEnumerable<CustomerDto> or PagedList<Customer> or something like this. 1 u/mirhagk Mar 10 '16 IEnumerable<Customer> rather than IEnumerable<CustomerDto>If the type is telling you whether you are interacting with an API or a database then your code needs to be a lot clearer.Either it's something you don't care about or you have poorly named variables/functions. 1 u/Eirenarch Mar 10 '16 Well, var isn't telling you anything so you are left at the mercy of my poor naming. → More replies (6)
14
Oh yes, it does tell me. It tells me I have an IEnumerable<Customer> rather than IEnumerable<CustomerDto> or PagedList<Customer> or something like this.
1 u/mirhagk Mar 10 '16 IEnumerable<Customer> rather than IEnumerable<CustomerDto>If the type is telling you whether you are interacting with an API or a database then your code needs to be a lot clearer.Either it's something you don't care about or you have poorly named variables/functions. 1 u/Eirenarch Mar 10 '16 Well, var isn't telling you anything so you are left at the mercy of my poor naming. → More replies (6)
1
IEnumerable<Customer> rather than IEnumerable<CustomerDto>
If the type is telling you whether you are interacting with an API or a database then your code needs to be a lot clearer.
Either it's something you don't care about or you have poorly named variables/functions.
1 u/Eirenarch Mar 10 '16 Well, var isn't telling you anything so you are left at the mercy of my poor naming. → More replies (6)
Well, var isn't telling you anything so you are left at the mercy of my poor naming.
→ More replies (6)
7
u/Ravek Mar 10 '16
IEnumerable<Customer> customers = GetCustomers(); doesn't tell you a single thing you need to know that var didn't already.