by chimeracoder · 14y ago · 0 comments
1. They haven't figured out a way to implement them without impacting performance significantly
2. They're not as necessary as you might think.
While they're open to adding them if #1 changes, in response to #2, I find I don't miss them as much as I would have thought - and that's coming from a strong advocate of statically typed, functional languages. In idiomatic Go, I just don't need them as often as I would have thought, and the interfaces are well-designed enough to make up for much of the difference.
http://golang.org/doc/go_faq.html#Why_doesnt_Go_have_feature...
Just because generics do not come up as often does not mean they won't make programs safer and/or faster. Almost all of the workarounds I have seen for the lack of generics can easily be applied to Java for instance.
There were several questions that came up on the Go mailing list asking how to convert certain code to make it more "idiomatic". The resulting code had several layers of indirection, interfaces composed of interfaces, and so on, that ironically it would have looked much more concise, and would have been type safe in a more "traditional OO" language like Java.
I don't think anyone denies that adding generics, if done properly, would improve the language. The only real controversial thing being suggested is that generics are not worth an implementation that is not up to standards. Personally, I think that is a reasonable position.