Hacker News new | ask | show | jobs
by throwaway415415 2681 days 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
1 comments

Go 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.

Usually 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.