Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Having come across a lot of resources out there for learning Scala from books, videos to online documentation... I wanted to know based on more experienced Scala developers on what do they suggest as a starting point to shift gradually from OO Java oriented style to FP Scala one?
If I can promote my own book, ;) I assume prior OOP experience, but no FP experience. I explain and emphasize the FP features first, to encourage people to use them who might tend to use more familiar OOP features. Then I discuss OOP details.
One thing I love about Scala is the way it uses OOP and FP as complementary features, providing the best of both paradigms. There are even features that make OOP programming, i.e., class hierarchies more robust for users:
1. You can prevent subclasses when the ones you defined are the only "logically sensible" subclasses for an abstraction that should be allowed.
2. There is a new mechanism that supports #1, but allows special case subclassing, such as when you write a test and want to subclass the tested class to stub out some of its behavior.
3. Scala traits provide richer "mixing" behaviors than Java interfaces with default method implementations.
4. Not widely used, but the private, protected, and public scopes exist with enhancements to scope the reach of private and protected (e.g., make it protected for this package and all packages under the parent package...).
There are lots of people who've written blog posts and done videos about OOP vs. FP. I don't have a recommendation about which ones are good. However, a few very good books that explore this subject directly are Neal Ford's "Functional Thinking" and the Manning books "Functional Programming in Scala" and "Functional Programming in Java", which are a bit more advanced.