Functional programming: The fastest way to learn it

Alternate titles for my book, Learn Functional Programming Without Fear, are, The Fastest Way to Learn Functional Programming and Learn Functional Programming the Fast Way. That’s because I found out — almost by accident — that the fastest way for object-oriented programming (OOP) developers to learn functional programming (FP) goes like this:

  1. Start with an OOP foundation, such as using Java, Kotlin, and other OOP languages
  2. Take a look at how you write methods in OOP languages
  3. Then look at how to solve problems using pure functions (and data types), and see how those functions are different from methods
  4. Add in immutable (algebraic) variables
  5. Add in immutable data structures
  6. Lastly, add in functional error-handling using Scala’s Option, Try, and Either data types

As I show in Learn Functional Programming Without Fear, if you follow this “OOP to FP” journey correctly, you’ll now be ready to use Scala/FP libraries like ZIO and Cats Effect.