3 ms·
Language like "self-inflicted wound" suggests there was either some strong objection to generics or that everyone was unaware they wanted them. That's not true.
by morelisp 5y ago
Language like "self-inflicted wound" suggests there was either some strong objection to generics or that everyone was unaware they wanted them. That's not true.
There's never been a strong design opposition to generics among the Go developers (note "the X developers" as distinct from the weird fanboy communities today of "X developers"), but it's always been balanced against other priorities, particularly compiler speed. C# and Java aren't quite so ready to throw stones in that area.
That being said, I don't think it's some uniquely praiseworthy thing either. For me that's actually more for things like `strings.Cut`; too many languages refuse to use their stdlib as a tool to push good design, especially good "micro-design".
- pcwalton 5y agoC# and Java have very fast compilers. A JIT is generally better for compilation speed than Go's approach, as a JIT only compiles code when it's executed. javac and csc.exe don't do any up-front code generation, while Go 6g/8g does. Besides, I don't think generics particularly affected C#/Java compilation speed.
- wbl 5y agoGenerics didn't affect Java because it doesn't have them after typing: it uses erasure and generates the same bytecode as pregeneric.