4 ms·
Would you recommend someone currently using F# to try out Scala?
by xupybd 4y ago
Would you recommend someone currently using F# to try out Scala?
- pharmakom 4y agoScala is both more functional than F# (type system has more features) and less functional (more emphasis on OOP). I don’t think it’s a net improvement tbh. Better JVM access is nice though.
- cbeach 4y agoWhy would OOP and functional programming be at opposite ends of a spectrum?
- pharmakom 4y agoMinimising state vs hiding state behind interfaces / methods The two can coexist in one code base but they are fundamentally opposed.
- SOLAR_FIELDS 4y agoA common joke in my previous org that heavily used Scala with functional paradigms is that an engineer’s first few PR’s were often implemented in “Scava” since Scala lets you lean into OO paradigms. It kind of means that there are two (or more) “right” ways to do things in Scala which IMO is a detriment to the language. This is where other languages like Python got it right by introducing the concept of “Pythonic”. You can do weird stuff, but it won’t be accepted into the zeitgeist that was defined by the benevolent dictator.
- theCodeStig 4y agoThey aren't diametrically opposed, though OO methods obscure function composition (point-free style).
- ghostwriter 4y agoA good example would be [1], where covariance and contra-variance are offered to you by the language due to its relation to OOP and the need for subtyping for it, whereas you'd probably be better off if you forgot about their existence (most of the times) and designed everything with Invariance and higher-kinded data [2]. [1] https://docs.scala-lang.org/tour/variances.html https://docs.scala-lang.org/tour/variances.html [2] https://reasonablypolymorphic.com/blog/higher-kinded-data/ https://reasonablypolymorphic.com/blog/higher-kinded-data/
- personomas 4y agoI don't have any experience with F#, so it's hard for me to say, but I love Scala. I think JVM is the best probably and could be worth your effort hard to say
- valenterry 4y agoF# does not really support pure functional programming in the sense that Scala does, so yeah. Use Scala ZIO and you will see what I mean. It also has some other nice features that F# lacks. But F# also has some nice things that Scala lacks. Overall I think it's worth to learn it for learning new concepts, but F# is already great, so don't expect Scala to be way ahead and even worse in some ways (syntax, no type providers, ...)
- ackfoobar 4y agoScala is also an FP language that places emphasis on types, but it does so in a way very different from F#, which is still based on Hindley–Milner. I think Scala is worth checking out for a different perspective.