Take the following snippet:
List distances = new List();
Was the redundancy intended by the language designers? If so, wh
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:
Stuttering (
foo.Foo* myFoo = new(foo.Foo)
) is reduced by simple type derivation using the:=
declare-and-initialize construct.