2 ms·
I don't think it has anything to do with dynamic or static typing, but more to do with teams, libraries and program design. I've had terrible experiences with
by revvx 7y ago
I don't think it has anything to do with dynamic or static typing, but more to do with teams, libraries and program design.
I've had terrible experiences with complexity and verbosity in Ruby and Python codebases, which are dynamically typed. On the other hand, I worked with super expressive and simple to work codebases in C# and Haskell. And I had the opposite experience as well in other times.
It is absolutely possible to have the cake and eat it in this regard.
In fact I'd consider Haskell way more expressive than any dynamic language I ever worked with.
- tombert 7y agoI love Haskell, and I agree that it's expressive, but any language with a nominal type system like Haskell is inherently going to be less expressive than a dynamic language. Compare these functions, one in JS and one in Haskell: function F (x) { var first = x.first; var second = x.second; return first + second; } vs. F :: (HasX a, HasY a) => a -> a F foo = (x foo) + (y foo) (I'm a little outta practice with both langauges, but my point will still stand) With the JS version, F can take in any expression that has the properties of `x` and `y`, while with the Haskell version, the type has to implement the typeclasses `HasX` and `HasY`. While the Haskell version is still better than something like Java because you can implement a typeclass without modifying the core datatype, it's still inherently less expressive. I'm not saying that it's not worth it (cuz Haskell is awesome for everything but records), but it's still less immediately reusable.