This is intentionally a small book with ONE GOAL: When you’re finished reading it, you should be able to go to the documentation for the world-class ZIO and Cats Effects functional programming libraries and think, “Aha! I know WHAT they’re doing, and WHY they’re doing it.” Once you achieve that goal, all you have to do is learn the specifics of either library.
Because that’s the one goal of this book, it doesn’t go into all the gory details that Alvin Alexander’s other books go into. But if you want to get started with FP as fast as possible, this is the fastest way he knows to get you up and running. An experienced OOP developer might be able to read this book in a weekend, or perhaps a week at most.
Get Started With ZIO & Cats Effect
Would you like to be able to learn what the fuss is about functional programming, without having to learn the abstract concepts in category theory? And would you like to understand world-class FP libraries like ZIO and Cats Effect that power high-performance, massively-parallel websites like Caesars and Disney Streaming?
This book takes you to the cusp of using those FP libraries — in the fastest way possible.
Written for OOP Developers
If you’re an OOP developer who uses programming languages like Java or Kotlin, Alvin understands your background. Alvin is a former Java/OOP instructor and mentor, and uses Kotlin for Android apps, and Flutter/Dart for iOS/Android apps. He has also used Python, Swift, Rust, Ruby, and other languages.
The Technique
Alvin Alexander “discovered” this learning technique while he was writing the 2nd Edition of the Scala Cookbook. Thanks to the new approaches in the ZIO library — which were released at that time — he found that if you really learn the Option, Try, and Either data types, they naturally lead to the ‘IO’ data type you hear about in the FP world, i.e., the ZIO type in the ZIO library and IO in Cats Effect.
A huge benefit of this approach is that if you just want to get started with those libraries — without having to learn abstract concepts like category theory, monoids, functors, monads, etc. — this book focuses on pragmatic knowledge and writing code.
The book consists of bite-sized lessons that are four pages on average, and each lesson adds a new piece of knowledge, until at the end of the book you’re writing FP code using ZIO.
(And if you still want to learn category theory at this point, you’re more than welcome to. It won’t hurt, but as Alvin shows, it’s not necessary.)
Your Learning Path
The book starts with a discussion of the Java/OOP code Alvin wrote for 15 years. He then shows how to solve programming problems functionsImmutable (algebraic) variablesImmutable data structuresThen it’s off to the races as he adds programming (EOP)Functional error handling with Option, Try, and EitherLastly, he shows how these techniques naturally lead to the concepts found in ZIO and Cats Effect. As Alvin says, if you had been interested in these techniques many years ago, you might have invented FP yourself.
It's a good book for those starting their journey with FP. But after reading this book a long journey ahead as these concepts you need to implement in everyday job to change a mindset.