Scala Reactive Programming
上QQ阅读APP看书,第一时间看更新

Benefits of functional programming

FP provides us with many benefits:

  • Thread-safe code
  • Easy-to-write concurrency and parallel code
  • We can write simple, readable, and elegant code
  • Type safety
  • Composability
  • Supports Declarative programming

As we use pure functions and immutability in FP, we will get thread-safety for free.

One of the greatest benefits of FP is function composability. We can compose multiple functions one by one and execute them either sequentially or parentally. It gives us a great approach to solve complex problems easily.