Functional Programming

What is it?

It's about values

Values lead to expressions

Functions as values lead to higher-order functions

It's about separating state

What's the big deal?

Loose coupling / High cohesion

Isn't this what it's always about?

Referential Transparency

How much of the system do you need to have in your head to understand a subset of the code?

Generalization / Reuse

It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.

Alan Perlis

Tips For Learning FP

Practice time

  1. Make it work
  2. Refactor for readability
  3. Refactor for concision
  4. Refactor for speed
  5. Rewrite a completely different way

Project time

  1. Make it work
  2. Refactor for readability
  3. Refactor when you have a deeper understanding

Learn the core functions

Separate state and side effects

Ask for help

Try them out in your environment

Be patient

/

#