3 ms·
Well, the first listed paradigm for Scala on wikipedia is functional, JavaScript and Ruby both have OO followed by imperative. And anyways supporting functional
by fhood 9y ago
Well, the first listed paradigm for Scala on wikipedia is functional, JavaScript and Ruby both have OO followed by imperative. And anyways supporting functional programming and being designed for it are not the same thing. Yeah, I can right functional Ruby, but that isn't going to be by initial inclination when writing a Ruby script. It would be for Scala.
- charlysl 9y agoSure, this is what I meant by natural. Just one thing: when you write that Ruby script, could one of the reasons why you don't use a FP style be not only that maybe it wouldn't be natural to do so in Ruby, but also that it's unsuitable for the kind of problem you are trying to solve with that script to begin with? I mention this, because I have the impression that people tend to believe that to solve a programming problem you should use whatever paradigm is perceived as the main one for the language at hand. However, I believe that it's the problem that should dictate the paradigm.
- fhood 9y agoI agree in principle, but rather than the problem dictating the paradigm, I would say it usually dictates the language. If a problem is well suited to a functional implementation then I'll probably break out Scala to solve it.
- charlysl 9y agoI agree, that would be the right to do. But the thing is, what if you are stuck with a given language, and/or its a biggish complex project where different aspects are better solved with different paradigms?