Best Sellers in Books
Discover the most popular and best selling products in Books based on sales

Disclosure: I get commissions for purchases made through links in this website
Computer Science - Functional Programming, Simplified: (Scala Edition)

Description

Book Synopsis: 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 goals: to use only immutable values and write only pure functions. But then later he learned the REAL truth: 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 book:

  1. All fields must be immutable (‘val’ fields).
  2. All functions must be pure functions.
  3. Null values are not allowed.
  4. Whenever you use an ‘if’ you must also use an ‘else’.
  5. You won’t create OOP classes that encapsulate data and behavior; instead you’ll design data structures using Scala ‘case’ classes, and write pure functions that operate on those data structures.

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:

Always ask “Why”?

Lessons in the book include:

  • How and why to write only pure functions
  • Why pure function signatures are much more important than OOP method signatures
  • Why recursion is a natural tool for functional programming, and how to write recursive algorithms
  • Because the Scala ‘for’ expression is so important to FP, dozens of pages explain the details of how it works
  • In the end you’ll see that monads aren’t that difficult because they’re a natural extension of the Five Rules

The book finishes with lessons on FP data modeling, and two main approaches for organizing your pure functions

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:

  • Grandma’s Cookies (a story about pure functions)
  • The ScalaCheck lessons
  • The Type Classes lessons
  • The appendices

Because those lessons didn’t fit in the print version, they have been made freely available online.

Details

Are you struggling to wrap your head around Functional Programming (FP)? You're not alone. Discover how Alvin Alexander, renowned author and former Java teacher, overcame his own challenges with FP in his best-selling book, Functional Programming, Simplified: Scala Edition. Unlike other FP resources that bombard you with complex theories and abstract concepts, Alexander breaks it down into simple, pragmatic lessons and examples.

With a focus on immutability and pure functions, Alexander reveals the true secret behind successful FP developers: they strive to make their code look and behave just like algebra. While this may sound daunting, Alexander demonstrates how these goals can be achieved through the use of advanced Scala features, which may seem foreign to beginners. But don't worry, he clarifies the benefits of writing pure functional code and provides five essential rules to guide your programming journey:

  1. All fields must be immutable
  2. All functions must be pure functions
  3. Null values are not allowed
  4. Every 'if' statement must have an 'else'
  5. Design data structures using Scala 'case' classes

Throughout the book, Alexander shares invaluable insights on why these rules are crucial in shaping your understanding of FP. You'll explore topics such as the significance of pure function signatures over OOP method signatures, leveraging recursion for functional programming, and unraveling the mystery behind monads. With a comprehensive breakdown of the Scala 'for' expression and lessons on FP data modeling, you'll gain the tools and knowledge to write code that aligns seamlessly with FP principles.

Ready to dive into the world of Functional Programming? Join countless individuals who have already benefited from Alexander's expertise. Get your copy of Functional Programming, Simplified: Scala Edition today and unlock the true power of FP!

Disclosure: I get commissions for purchases made through links in this website