These are chat archives for dennisdoomen/CSharpGuidelines
A set of coding guidelines for C# 3.0, C# 4.0 and C# 5.0, design principles and layout rules for improving the overall quality of your code development.
var myfoo = MyFactoryMethod.Create("arg");
var, it will be more difficult to spot.
varshould only be used if the type is obvious from the context.
varprotects that. Could you please give a simple example?
var employees = repository.FindEmployees(criteria); // Don't really care about 'customers' type. Whether it IEnumerable<Person>, IList or List. Just know that it has a collection semantic. var topSalary = employees.Select(var emp => emp.CalculateYearSalary()).Max(); // While I don't know exact type of 'topSalary' would be, it's not that important to me. I'm pretty sure it's primitive type like Integer or Double.