4 ms·
Typeclasses and parametric types are there to leverage the typesystem. It's hard to see how you can benefit from these abstractions if all you have is ducktypin
by fakedrake 9y ago
Typeclasses and parametric types are there to leverage the typesystem. It's hard to see how you can benefit from these abstractions if all you have is ducktyping.
- zwerdlds 9y agoNot a genuine answer, but JavaScript has a great ability to inspire respect for type systems, due to that duck typing. I suppose the GP enforced it manually?
- hota_mazi 9y agoJavascript doesn't support duck typing. It doesn't support any typing actually: it's dynamically typed. If Javascript can inspire respect for type systems, it's by making you realize that not having type annotations leads to terrible, unmaintainable code.
- zwerdlds 9y agoYes, that was my point.
- gnaritas 9y ago> Javascript doesn't support duck typing. It doesn't support any typing actually: it's dynamically typed. Dynamically typed doesn't mean untyped; you still have types in JavaScript. Most dynamic languages are strongly typed, not untyped. You're conflating a few unrelated things. JavaScript is duck typed, as virtually all dynamic languages are.
- seanmcdirmid 9y agoDynamic typing is a typing. Also, duck typing is used more in the dynamic sense than the static sense, where in the latter it is instead called structural typing.
- palunon 9y agoDynamic typing isn't lack of typing. The fact that types cannot be statically checked doesn't mean you don't have any. Bash only has one type, the string, and is thus statically typed. Is Bash's type system better than say, Python's ?
- gnaritas 9y agoThose abstractions are about static typing, not functional programming. Functional programming doesn't require static types.
- cat199 9y agodingdingding! we have a winner )))