3 ms·
There isn't one. Go, by design, does not provide generics as they would complicate the language and for insufficient benefit. (according to at least one of the
by eigenrick 12y ago
There isn't one. Go, by design, does not provide generics as they would complicate the language and for insufficient benefit. (according to at least one of the authors)
While I do agree that Generics can open up a whole new dimension of programming concerns. I think they are worth the additional syntactic complexity, because they allow you absolute accuracy when it comes to types. If we as a programming community want to ever get to the point where we have provably correct programs, or even reasonably correct programs, clear definitions of functions for an exact set of types is a necessity.
- rwallace 12y agoAnd conversely if you don't care about types, you might as well use a dynamic language and get something concise and flexible. A static type system without generics is the worst of both worlds; it gets in your way a lot while still not providing guarantees of type safety.