

A conversation with the Go team - enneff
http://blog.golang.org/a-conversation-with-the-go-team

======
galaktor
"What surprises me is that almost nobody complains about the lack of
generics."

Strange. Lack of generics is probably the single most common thing I read/hear
people complain about.

(Btw, I like and use Go)

~~~
tocomment
Sorry what's a generic? Can you explain it in Delphi 6 terms? er actually
Python terms would be even better.

~~~
hugorodgerbrown
Generics are used to defer type setting from compile time to run time,
allowing for flexible, yet type-safe constructs.

The classic example is a list (in a strongly-typed language) - without
generics you would create specialised strongly-typed list classes - you could
have a StringList (only strings), an IntList (only ints), etc.

Using generics you can define a single list class of type <T>, where <T> is
any type. Then at runtime you would create a List<String> or a List<Int>. Same
outcome, less code, easier to maintain.

MSDN has a good intro to C# generics - [http://msdn.microsoft.com/en-
us/library/ms379564(v=vs.80).as...](http://msdn.microsoft.com/en-
us/library/ms379564\(v=vs.80\).aspx)

They are less appropriate in dynamic languages, as type-safety isn't a compile
time concern.

~~~
throwit1979
Runtime? Huh?

Whether it's static or dynamic is language-dependent. Example: Java in
particular does erasure on parameterized types, so generics are _only_
compile-time.

------
ilSignorCarlo
It was so disappointing when I realized it was not referred to the band

~~~
skinofstars
Yep, but at least it's a good reminder to listen to them.

