Developer, Former MVP, now at Microsoft - Best of 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
var i = 3;var s = "hi";var o = new SomeType();
int i = 3;string s = "hi";SomeType o = new SomeType();
var b = true;b = false; //fineb = "pull the other one"; //Cannot implicitly convert type 'string' to 'bool'
IEnumerable<SomeType> col = new SomeCollectionType();foreach (var a in col) //a is inferred by the compiler to be SomeType{ a.MethodOnSomeType(); //intellisense here pops-up as expected}
// I'd rather type thisvar myCol = new Dictionary<int, SomeType>();//...than type thisDictionary<int, SomeType> myCol = new Dictionary<int, SomeType>();