News for hackers. Stuff that matters.
Re:A conversation with the Go team by tocomment on Thursday June 06, 2013 @08:36AM (#5831978)
What's so good about that? Isn't it more convenient to be able to store different types together in the same collection?
Re:A conversation with the Go team by coldtea on Thursday June 06, 2013 @09:26AM (#5832247)
No. You typically want different types of the same kind, or of the same family (e.g numeric types or types that extend some interface, etc), not every random thing thrown in.

If it was truly whatever type, how would you know what to do with it when you got it out of the collection?

E.g

foo = myColection.get(2);

foo.?????? (what operations can foo afford?)

Re:A conversation with the Go team by sluukkonen on Thursday June 06, 2013 @08:57AM (#5832081)
It can be more convenient, but the added type safety prevents the programmer from doing many kinds of common mistakes. It's a trade-off.