aspose file tools*
The moose likes Scala and the fly likes Advice to code in FP style Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Scala
Bookmark "Advice to code in FP style" Watch "Advice to code in FP style" New topic
Author

Advice to code in FP style

Raymond Tong
Ranch Hand

Joined: Aug 15, 2010
Posts: 230
    
    2

Hi,

Scala is a hybrid language that could code in FP and OO style.
Any advice to help people from OO background to think and write in FP style in Scala?
Would you think it would be better to learn FP in pure FP language like Clojure, Haskell?

Thanks,
Raymond
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9521
    
    2

Raymond Tong wrote:Hi,

Scala is a hybrid language that could code in FP and OO style.
Any advice to help people from OO background to think and write in FP style in Scala?
Would you think it would be better to learn FP in pure FP language like Clojure, Haskell?

Thanks,
Raymond


From my personal experience, I found that a gradual migration from an imperative style to a functional style helps a lot. Scala is very much adept at it since it is both a FP as well as OOP as opposed to purely FP languages like Haskell and co.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
 
Don't get me started about those stupid light bulbs.
 
subject: Advice to code in FP style