4 ms·
> Remember, both c++ and Java got generics added on (and c# followed Java's lead). C++ got templates 27 years ago. Java got generics 13 years ago. C# got them
by munificent 9y ago
> Remember, both c++ and Java got generics added on (and c# followed Java's lead).
C++ got templates 27 years ago. Java got generics 13 years ago. C# got them 12 years ago. Go was launched 10 years ago. I can't think of a single statically typed language with significant use when Go was developed that didn't have some for of type parametricity. Maybe C, but you could argue C users can simply opt into C++ if they want that.
The Go folks aren't risking being on the wrong side if they history if they don't add generics. They were on the wrong side of history when the language launched.
I do understand that generics are very difficult in an ahead-of-time compiled language where fast modular compiles are a priority one goal. I'm not saying its easy, at all. But there's no shortage of brilliant folks on the team. If they put their minds to it, they could solve this.
Maybe it was because they had the luxury of controlling the language and core libraries. They could make the types and functions they cared about -- channels, arrays, slices, maps, append(), etc. generic since they could bake them right into the language. It's really easy to not empathize with a user's problem if you don't experience it yourself.