Learning Haskell with a view to learning Scala

前端 未结 6 761
花落未央
花落未央 2021-01-31 07:57

I\'ve read a few questions such as Scala vs Haskell discussing the merits of both languages or which to learn, but I already know that I\'d like to learn Scala. I was a Java pro

6条回答
  •  醉话见心
    2021-01-31 08:34

    Speaking as someone who came from Java, and for whom Scala was a gateway drug to Haskell, I happen to think this is a great idea (learn Haskell first)!

    Haskell is conceptually a much simpler language than Scala, and if your goal is to learn how to program functionally, you can't help but do so if you start with Haskell. By design, Scala supports a kind of "legacy mode" of coding in which you don't really have to change your Java (or PHP) habits too much if you don't want to. I think this is a strategic decision--and a good one!--meant to increase adoption amongst crusty Java stalwarts.

    But that's not you! You're actually interested in learning something new... so why not go all-out? Learning functional programming in a pure setting, without the clutter and the temptation to regress into old habits, will crystallize the concepts in your brain.

    Then by all means return to Scala and learn how it differs from Haskell; it is both weaker in some respects and stronger in others, but you will then be on a much better foundation to appreciate these differences.

提交回复
热议问题