If you’ve had trouble trying to learn Functional Programming (FP), you’re not alone. In this best-selling, highly-rated book, Alvin Alexander — author of the Scala Cookbook for O’Reilly, the Scala Book for the official Scala website, 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 (and you can too!).
In this classic book, which is one of the highest-selling FP books of all time, he teaches FP in a simple style, without worrying about abstract concepts like functors, monads, and category theory. Instead, he explains FP through a series of small, pragmatic lessons and examples. For instance, the first thing he learned is that experienced FP developers (FPers) are driven by two to use only immutable values and write only pure functions . But then later he learned the REAL FPers have these goals because their true desire — or mental model — is that 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 some 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 you write code like this?’” But then 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 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 Lessons in the book 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 Because those lessons didn’t fit in the print version, they have been made freely available online.
Fantastic resource for those who are terrified of monads and functors yet know basics of Scala and functional programming.
Alvin Alexander is an incredible author who believes learning functional programming doesn't have to be a pain. The book is written in a very simple language, reading it is nearly like chatting to a really good friend. I giggled at some of the puns! Also - there is memes, it makes reading this book a pure pleasure. I in fact did read the first 10 chapters or so sipping my tea.
What's so outstanding about the book? Two things.
Thing number one: chapters are very short. It's so easy to chunk the workload. Also, doing 3 chapters in one day sounds like you're making great progress.
Thing number two: His explanations often at first don't mention "scary" words such as monad or functor but instead what he does is: 1. Show reader a problem, get a reader to think of how they'd solve it 2. Know your reader doesn't know fp principals and show them their solution likely isn't functional 3. Show them a functional-ish solution that will be very easy to grasp 4. Build on 3. and show them a pure functional solution that's more difficult yet still logical and clear to understand 5. Tell them something along the way of "Ah, by the way, you just implemented a scary functor. Wasn't bad now, was it?" 6. Reader's jaw dropped
100/5, there is just not enough stars for this book.
Finally, a book that teaches functional programming in an easy and approachable manner. Such sources are very rare. The author went through a lot of books and articles and put together a single resource for us - mortals - to learn functional programming properly. He explains FP-related vocabulary that sounds intimidating when you first encounter it (especially if you have no extensive math or FP background). Every basic aspect of functional programming is dissected, described and shown in multiple examples. It will make you wonder why you thought functional programming is difficult.
Note: All code examples used throughout the book are written in Scala. In order to be able to use this book, you should know at least the basics of Scala and have it set up on your machine to run the code on your own or try to do the exercises.
Most enjoyable book I’ve read by far. Simple, intuitive and very detailed, FP Simplified (Scala ed) covers everything you’d ever ask about Functional Programming paradigm. The author guides the reader through concepts in a way the reader will get the point. Then, he names the concept explained how it’s known as.
I don’t recommend this book for people who don’t know Scala, though. I’d suggest to read some of Scala lang before read this one.
This book explains the main concepts that are needed to understand Functional programming in Scala. I recommend it to beginning Scala programmers who want to learn about functional programming.
Pros: Covers the basics of functional programming (Scala) very well. Small, easy to follow lessons. There are lots of code examples, even more given on the author’s github pages. Monad chapters are good for learning their basic usage.
Cons: Sometimes I felt more like I am reading a blog post rather than a book. I can’t explain why. One reason may be there are way too much quotes from other authors’ books, blogs, etc. in almost every chapter. It’s not bad, but I found it a bit unusual in a book.
After completing this book I am feeling confident to start reading “the red book” (FP in scala) again.
Note 1: I've actually finished 2nd edition, but I don't think there's a separate page for it yet Note 2: 2nd edition is still WiP, while most of the book is there, one chapter is absent, and there are few minor errors.
Leaving this one without a rating. Not very useful for me as it's really aimed at people who are unfamiliar with Scala, or use it plainly as Java. It won't make a type astronaut out of you, but would give some understanding of how FP code should look like. What I found missing is actual real-life applications that were promised in book's description - FP looks nice and rosy while you're explaining it on small examples, but becomes much trickier once you need to write something real, even a simple CRUD - couple of REST endpoints, talking to DB etc. Maybe it will be touched on in the missing chapter, but at this point it's not there.
This blog-like book is possibly the gentlest introduction to functional programming ever. Note: it's really for absolute beginners to functional programming. That said, I liked Alvin Alexander's approach to introduce FP from the point of view of experienced (and sceptical) procedural/object-oriented programmer. Gradually, FP concepts are introduced, their downsides pointed out and remedies offered. This way the reader learns not only how, but also why various FP strategies look the way they are.
On the downside, I think the book could be shorter by ~200 pages without significant loss of the amount of conveyed information. Instead of many repetitions, it would be better to offer at least a quick glance at algebraic data types.
There are many very fine books on learning Scala FP, but this one definitely stands out. It almost reads like a novel. You start with some simple premise and while turning the pages all the advanced functional programming concepts come along without ever scaring you. There are sections on immutability, recursion, monads, for comprehensions, handling state and pure functions, concurrency and above all a very very very instructive part about program organisation (where to put your pure functions) for those coming from an OO background. Read it cover to cover while following a Scala FP MOOC course. Alvin is the Scala man!
Quite a fine book. It's clear that Alvin has a mountain of knowledge on the topic. However, to put it short, it's far too long and surprisingly not in-depth enough. It explains what monads and functors are in too much of a "practical" way that it makes it not very easy to generalize these abstractions to anything other than scala. It's a great book to get started with functional programming, but please, make sure it won't be your last or you'll remain with a very limited overview of what functional programming is.
A very good explanation of Functional Programming, the books cite and compare so many sources. But most parts of books explain Scala FP features, so if you want to implement the concept using other languages than Scala and you have experience with Scala you can to skip a lot of chapters.
This book also good if you want to know more about Functional Features in Scala.
I hope someday Alvin Alexander will write this book using other Language than Scala such as Kotlin.
Good read. The explanations of concepts are clear and well written.
Keep in mind is this for people who really are brand new to functional concepts. If you have had any prior exposure to FP, you've probably already covered most of the book.
I would also echo one of the criticisms in previous reviews. The contents could have been greatly condensed and simplified. The book should really be half the size.
A very practical and light comprehensive lecture on scala and functional programming. It contains many examples, all very easy to follow along even without an IDE or else. It demystifies concepts such as ADT, functor, monads, etc. The only downsides I can think of are: it assumes you have basic knowledge of scala syntax, and some examples are too simple. More complex's would be nice. But for the latter, the author's website is filled.
Achei fantástica a forma com a qual o livro é estruturada: uma infinidade de objetivos pequenos, que tem o problema muito bem definido e a solução bem elaborada. Não, não é um cookbook, os tópicos vão seguindo uma ordem crescente de aprofundamento no paradigma funcional.
Technical content: 4 stars (except the small part about Spark). After reading it I feel I have a better grasp of functional programming concepts and where to go from there.
Style: 2 stars. 900 pages and 130 chapters (without the appendices) for what feels more like reading 130 blog posts copy-pasted in a book, or a draft of a book. It feels to me a lot could have been explained in a much more concise way, maybe with the help of a skilled editor. With a better style the same content likely could be explained in about 300 pages and become a really good introduction to functional programming.