Functional Programming

Functional programming (FP) has been around for decades, but it’s finally gaining much needed traction. If you’ve mostly done OOP it’ll take some effort to get comfortable with FP, but Scala eases the burden quite a bit.

The nature of Scala being a hybrid language—we can write in both imperative and functional style—can be a blessing and a curse. It’s a blessing because when writing code in Scala, we can make it work and make it better. Programmers new to FP can initially write code in imperative style and refactor it to functional style. Also, if a particular algorithm will truly benefit from an imperative implementation, we can easily code that in Scala. However, it could be a curse if teams use this flexibility to arbitrarily ...

Get Pragmatic Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.