Skip to content

Comment on Should Go 2.0 support generics?

Comments

It's interesting that it's 2017 and this question still gets asked. Go having static types but no generics is the worst of two worlds: both dynamic languages and compiled languages with genetics have basic functional constructs like map/reduce but Go insists on sprinkling interface {} everywhere and calls this "solution" good enough?

Where do you see interface{} getting sprinkled?

Any libraries or anything in particular?

https://godoc.org/golang.org/x/sync/syncmap leaps to mind as a type whose users should demand and get static type safety, but it can't happen until the language definition adds yet another special case blessing it as a properly supported collection type.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.