3 ms·
With dynamically languages, the type of an object is not important so you don't need to explicitly typecast external objects to fit into your logic. With dynami
by grosjona 8y ago
With dynamically languages, the type of an object is not important so you don't need to explicitly typecast external objects to fit into your logic. With dynamically typed languages, if two different objects expose the same functions then you can use them in the same way. The behavior of an object is all that counts.
- wtetzner 8y agoYou seem to be talking about nominal types being a problem. Structural subtyping and row types are two ways of getting the benefits you're talking about while still being statically typed.
- mannykannot 8y agoIf two different objects expose the same functions then you can call them in the same way. You have no way of knowing, from the function names and arity, whether their semantics are what you need. Once you start asking that question, you are asking the sort of questions that using types helps answer.