3 ms·
Dinamic languages don't need generics
by pmarin 11y ago
Dinamic languages don't need generics
- brndn 11y agoCan you explain?
- pmarin 11y agoIn dynamic languages the type is known at runtime.
- nostrademons 11y agoThe point of generics is so that you can use the same code with many different types. With dynamic typing, you can use the same code with anything, it just complains at runtime if you call an operation that isn't supported on a particular type. It's like every operation is implicitly generic. You could look at generics as a way to bring some of the flexibility of dynamic languages to a static type system, so you get the expressivity benefits without sacrificing type-safety.