> they lose both type safety and performance
I guess you think generics is a magic pixie dust that has the exact performance envelope as non-generic code?
I guess you think generics is a magic pixie dust that has the exact performance envelope as non-generic code?
And what are we optimizing for anyway? Reading a bunch of code that uses an off-the-shelf library's Stack or Tree or whatever is always going to be easier to read than having to also have to inspect the three hand-rolled Tree implementations, two of which are probably buggy, in addition to the actual client code trying to use the tree to do real work. Or a library that implemented it using interface{} which is a big middle finger to the whole type system, completely discarding the compiler's ability to detect otherwise trivial mistakes.