Take the following snippet:
List<int> distances = new List<int>();
Was the redundancy intended by the language designers? If so, why?
Take the following snippet:
List<int> distances = new List<int>();
Was the redundancy intended by the language designers? If so, why?
It's only "redundant" if you are comparing it to dynamically typed languages. It's useful for polymorphism and finding bugs at compile time. Also, it makes code auto-complete/intellisense easier for your IDE (if you use one).
Your particular example is indeed a bit verbose but in most ways C# is rather lean.
I'd much prefer this (C#)
to this (VB.NET)
Now, the particular example you chose is something about .NET in general which is a bit on the long side, but I don't think that's C#'s fault. Maybe the question should be rephrased "Why is .NET code so verbose?"
In many of the answers to this question, the authors are thinking like compilers or apologists. An important rule of good programming is Don't repeat yourself!
Avoiding this unnecessary repetition is an explicit design goal of Go, for example:
What's redudant about this?
Translated to English: (EDIT, cleaned up a little for clarification)
Not really verbose when you think about what it does.
Of course there is an alternative:
Here we are using C#'s type inference, because you are assigning to it immediately, C# can figure out what type you want to create by the object just created in the heap.
To fully understand how the CLR handles types, I recommend reading CLR Via C#.
A historical artifact of static typing / C syntax; compare the Ruby example:
Use var if it is obvious what the type is to the reader.
From microsofts C# programing guide