I have seen C# style guides that forbid var.
I have seen C# style guides that forbid var.
var example = new CustomClass();
and style guides the require it unless the code will actually break.To quote the GP:
> Not saying that it doesn't happen. Every place has its weird "thing"
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>>();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.
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.
EDIT: It turns out the parent and I agree 100%. Darn double negatives! :)
I personally start with min noise and add stuff (accessibility, explicit types, this, LINQ query syntax) based on the team.
The only hard standard is braces: I like terse but too often you then get massive unreadable blocks.