| If your language has you type more because it has a static ype system then it's just poor at inferring types and/or it's syntax has you write out things that it could infer anyway. You may have to write types in C# from time to time, but often you don't have to: // This an array of integers. var x = new[]{1, 2, 3}; // This is a list of integers. var y = x.ToList(); // This is an anonymous type. var pet = new { Age = 10, Name = "Fluffy" }; Zero type names there. Not all types can be inferred by literals though, most annoyingly dictionaries: var myDict = new Dictionary<string, string>{
{ "test", "test" },
{ "test2", "test2" }
}; although I'm sure that could also have been created without typing out the name if you really wanted. |