5 ms·
Because they are easily abused (look at c++) and makes code unreadable. Working around generics usually make the code clearer and thus more secure
by throwaway415415 8y ago
Because they are easily abused (look at c++) and makes code unreadable. Working around generics usually make the code clearer and thus more secure
- latronic_notron 8y agoGo has interface{}, which can be abused as much as generics for the same purpose, but without the type safety, hence, less secure. And nobody is advocating C++ style template metaprogramming. There are much better implementations of generics, as acknowledged by Russ Cox himself.
- throwaway415415 8y agoUsually interface{} is abused by java programmers. I agree that it's not great, but if you don't come from java or c++ chances you won't follow these patterns at least.