News for hackers. Stuff that matters.
Re:Why Isn’t F# the King of .NET? by nathanaldensr on Monday September 19, 2016 @08:03AM (#12530661)
This is how I've had my ReSharper code formatting rules set up for years. I only use var when the type name explicitly appears on the RHS of the equal sign (e.g., in an explicit cast, a generic type parameter, a constructor, etc.)

var is an excellent way to reduce redundancy in an assignment expression; it helps avoid stuff like:

  Dictionary<int, List<CustomClass>> dictionary = new Dictionary<int, List<CustomClass>>();
Re:Why Isn’t F# the King of .NET? by pc86 on Monday September 19, 2016 @08:22AM (#12530791)
Exactly how I use it (var) as well, only I haven't taken the time to tell ReSharper that's how I do it :)

Basically if I know what the type is by looking at that line of code, I will use var. If I don't, I won't.

Re:Why Isn’t F# the King of .NET? by jeswin on Monday September 19, 2016 @12:13PM (#12532506)
The more widely held view is that var should be used as much as possible, as you can see in Resharper defaults. You needn't care about the types, if the compiler handles it for you. Code like int sum = getSum() needn't break if the getSum() implementation switched to using longs. There will be exceptions, of course.

People get by with dynamic types. Much better with structural types. You're having full nominal typing and using LHS declaration for documentation. Which if ever needed (typically you shouldn't), hovering over it gives you anyway.

Re:Why Isn’t F# the King of .NET? by pjmlp on Monday September 19, 2016 @08:26AM (#12530825)
That is one of the ways I usually use it, also auto in C++.