Programming in Scala: Updated for Scala 2.12
Update: On May 5, 2019 the second version of this book was released. It greatly improves on the book’s text formatting, reducing its page count by over 50 pages and making it even easier to read.
If you’ve had trouble trying to learn Functional Programming (FP), you’re not alone. In this book, Alvin Alexander — author of the Scala Cookbook and former teacher of Java and Object-Oriented Programming (OOP) classes — writes about his own problems in trying to understand FP, and how he finally conquered it.
What he originally learned is that experienced FP developers are driven by two goals: to use only immutable values, and write only pure functions. What he later learned is that they have these goals as the result of another larger goal: they want all of their code to look and work just like algebra.
While that sounds simple, it turns out that these goals require them to use many advanced Scala features — which they often use all at the same time. As a result, their code can look completely foreign to novice FP developers. As Mr. Alexander writes, “When you first see their code it’s easy to ask, ‘Why would anyone write code like this?’â€
Mr. Alexander answers that “Why?†question by explaining the benefits of writing pure functional code. Once you understand those benefits — your motivation for learning FP — he shares five rules for programming in the book:
In the book you’ll see how those five, simple rules naturally lead you to write pure, functional code that reads like algebra. He also shares one more Golden Rule for learning:
Lessons in the book include:
As Mr. Alexander writes, “In this book I take the time to explain all of the concepts that are used to write FP code in Scala. As I learned from my own experience, once you understand the Five Rules and the small concepts, you can understand Scala/FP.â€
Please note that because of the limits on how large a printed book can be, the paperback version does not include all of the chapters that are in the Kindle eBook. The following lessons are not in the paperback version:
Because those lessons didn’ fit in the print version, they have been made freely available online.
(Alvin Alexander (alvinalexander.com) wrote the popular Scala Cookbook for O’Reilly, and also self-published two other books, How I Sold My Business: A Personal Diary, and A Survival Guide for New Consultants.)
Country | USA |
Manufacturer | CreateSpace Independent Publishing Platform |
Binding | Paperback |
EANs | 9781979788786 |
ReleaseDate | 0000-00-00 |