4 ms·
They're the same thing: "Generics" is a term from software engineering, describing how the concept is typically used. "Parametric polymorphism" is a descripti
by mcguire 8y ago
They're the same thing:
"Generics" is a term from software engineering, describing how the concept is typically used.
"Parametric polymorphism" is a description from a type theoretic standpoint.
"Templates" are an implementation strategy.
- dbaupp 8y agoI understand what these words mean... At least, I understand the variety of meanings they have: they're not always used to mean the same thing. For instance, people will rightly say that Java doesn't strictly have parametric polymorphism because of dynamic type casts, but they will say it has generics. Other people might draw a distinction between generics and templates, with the former being constrained (with type classes or similar) and the latter being macro-like. However, I don't think these are actually particularly relevant to the original comment (and, I really think that Rust probably satisfies "generics" more than "parametric polymorphism", because one can also do generic casts).