3 ms·
Static and dynamic typing tend to fall down in different ways at Big Code. Dynamic typing can make some kinds of versioning hell in distributed systems less of
by michaelochurch 13y ago
Static and dynamic typing tend to fall down in different ways at Big Code. Dynamic typing can make some kinds of versioning hell in distributed systems less of a problem (which is why languages designed for distribution, like Erlang) tend to be dynamic, and compile speed can be a massive PITA in a language with a static type system worth using (like Scala).
If you're using Java or C++ or mainstream OOP, you're not getting the benefits out of static typing anyway and a Python or Clojure is a big improvement. That said, there are domains where compile-time static typing is extremely useful (and justifies the associated costs due to, e.g., the loss of a Lisp's intuitive macro system and first-class REPL) but those are going to call for a Hindley-Milner type system, not Java's weird mess of one.
- scott_s 13y agoIf you're programming in Java, C++ or another OOP language, you are still getting benefits from static typing. It's not as strong as if you were programming in a language with a more robust type system, but I cannot agree that there is no benefit.
- _random_ 13y agoCorrect, dynamic languages are very good for scripting and as a glue between components.
- detrino 13y ago> If you're using Java or C++ or mainstream OOP, you're not getting the benefits out of static typing anyway What is it that about Java or C++ or OOP that you think makes their static typing useless? > but those are going to call for a Hindley-Milner type system, not Java's weird mess of one. Hindley-Milner is actually a poor type system. It trades away powerful features like overloading and subtyping in exchange for global type inference. Scala, like C++ and C#, does not use Hindley-Milner but a kind of local type inference.
- mightybyte 13y ago> What is it that about Java or C++ or OOP that you think makes their static typing useless? He's not saying their static typing is useless. He's saying it's not an accurate representation of the state-of-the-art in static type systems. > Hindley-Milner is actually a poor type system. It trades away powerful features like overloading and subtyping in exchange for global type inference. Something that you may think is a good idea in one context may not be such a good idea in another context. I'll take Haskell's type classes over subtyping any day.
- detrino 13y ago> He's not saying their static typing is useless. He's saying it's not an accurate representation of the state-of-the-art in static type systems. Perhaps he meant to say "full benefits" and it was only a typo. > I'll take Haskell's type classes over subtyping any day. Type classes and subtyping are not incompatible.
- mercurial 13y ago> Hindley-Milner is actually a poor type system. It trades away powerful features like overloading and subtyping in exchange for global type inference. Scala, like C++ and C#, does not use Hindley-Milner but a kind of local type inference. On the other hand, subtyping does add a large amount of complexity and is misused about 90% of the time.