5 ms·
I would recommend the stairway book and the coursera course. I would also steer away from the some of the other recommendations posted here, including "Function
by sreque 10y ago
I would recommend the stairway book and the coursera course. I would also steer away from the some of the other recommendations posted here, including "Functional Programming in Scala", which are basically teaching you how to write Haskell in Scala. I don't think this is a good way to learn Scala because I don't think Haskell-style code makes for effective Scala.
- dominotw 10y ago>I don't think this is a good way to learn Scala because I don't think Haskell-style code makes for effective Scala. Why is writing functional code in scala not effective? How would one go about understanding 'for comprehensions' in scala without understanding what flatMap/map is used for in lieu if exception. Or why pattern matching is used.
- sreque 10y agoIn my opinion, functional programming, like most programming terms, including object-oriented programming, means very different things to different people. For example: 1. The LISP family of languages encourages a style of functional programming that eschews static type systems, relies heavily on macros and algorithms involving singly-linked lists, and doesn't mind exposing the ability to mutate state. 2. The ML family of languages, of which I am the least familiar, are statically typed, but are also OK exposing mutable state and do not track any effects in their type systems. 3. Haskell heavily pushes reliance on Monads, monad transformers, and effects/state tracking through the above. 4. Proof assistants and similar languages like Coq go beyond tracking effects in the type system; they track values themselves, and essentially require you to prove mathematically that your program is correct. So, given the above, what do you mean by functional programming? From the talks I've seen given by the creator of Scala itself, I believe he sees Scala as fitting in with the ML family languages moreso than Haskell. Also, the way Scala's type system and runtime currently work, I don't think it's a good fit for Haskell-style programming. I tend to find monad transformer-based code in Scala exceedingly ugly and difficult to read compared to Haskell. The underlying runtime itself also has little mechanism for optimizing monad-based code, whereas the GHC compiler has probably man-years of effort spent into optimizing code using monads.