Lately, we have found that we've accustomed to declare C#'s local variables using var:
var
var exitStateName = exitState == null ? "" : exitState.Name; var rules = Environment.NavigationRules; var rule = rules[caller.Name]; var flow = rule.NavigationCases[procedure.OriginExitState];
This makes code cleaner, and in presense of good IDE still allows to figure out types very easely.
We, howerer, found that var tends to have exceptions in its uses. E.g. for some reason most of boolean locals in our code tend to remain explicit (matter of taste?):
bool succeed = false; try { ... succeed = true; } finally { if (!succeed) { ... } }
Also, type often survives in for, but not in foreach:
for
foreach
for(int i = 0; i < sourceDataMapping.Length; ++i) { ... } foreach(var property in properties) { ... }
In addition var has some limitations, as one cannot easily initialize such local with null. From the following we prefer the first approach:
IWindowContext context = null;
var context = (IWindowContext)null;
var context = null as IWindowContext;
var context = default(IWindowContext);
We might need to figure out a consistent code style as for var. It might be like that:
Another code style could be like that:
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u