5 ms·
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 compile
by jeswin 10y ago
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.