3 ms·
Those are summaries of responses I've gotten when discussing this a long time ago (before the language team decided to figure out how to incorporate generics).
by sanderjd 5y ago
Those are summaries of responses I've gotten when discussing this a long time ago (before the language team decided to figure out how to incorporate generics). I'm not sure the exact actual wording, but that's very much how it came off to me, that there's no way to be both smart and experienced and simultaneously convinced that generics are an extremely useful language feature. These debates don't get so heated now, because even the go designers themselves conceded the point long ago.
Your more nuanced version of the argument is also wrong though. Experience from other languages is always applicable. Even for beginners, it is obvious and correct to ask "wouldn't we save a lot of repetition if we could write a generic version of this function instead of tediously rewriting the same thing for a bunch of types?". The correct and very reasonable response is "yes, but the designers of this language chose not to support that functionality in an effort to maintain simplicity". The right answer is not "no, this language is unique such that that technique is not applicable to it". That's gaslighting, and much worse when directed toward beginners who will just conclude that they must be wrong, when they aren't.
I agree with your last paragraph in general, but in this case that's not what was going on. Saying that the language would not actually benefit from polymorphism was not true, it was just a rationalization for leaving out a useful feature. It's the difference between "yeah that would be useful but we don't think the complexity it brings is worth it" vs. "that is not useful in this language for reasons you aren't wise enough to understand".