Monday, November 2, 2020

FP. Why Functional Programming?

https://serokell.io/blog/introduction-to-functional-programming


LIPS or SLIP or "PILLS":
  • Purity. There's a clear boundary between pure code (composed of pure functions) and impure code (input/output).
  • Static typing. Types are checked at compile-time, not at run-time. This prevents a lot of run-time crashes in exchange for having to actually deal with types, which some find difficult.
  • Laziness. Expressions are evaluated only when the value of the expression is needed in contrast to strict evaluation where the expression is evaluated when it is bound to the variable.
  • Immutability. The data structures are immutable.

No comments: