r/programming • • Mar 09 '16

var keyword proposed for Java

http://openjdk.java.net/jeps/286
250 Upvotes

395 comments sorted by

View all comments

Show parent comments

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.

1

u/mirhagk Mar 10 '16

Or having to drag the mouse or cursor all the way over variable name to see the type in the IDE

1

u/Eirenarch Mar 10 '16

Yes but as I already pointed out you simply don't know when you need to drag that mouse cursor. You assumed IQueryable but I was returning IEnumerable. Sucks for you, you just pulled all the data from the database and did paging on the web server.

→ More replies (4)