4 ms·
Can you explain?
by brndn 10y ago
Can you explain?
- pmarin 10y agoIn dynamic languages the type is known at runtime.
- nostrademons 10y 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.