Functional Programming analogies
Functional programming is a programming style where you use pure functions
Non-Pure functions are like my ex-boyfriend
- They might return no value
- They don’t need my input
- May cause side effects (ask my therapist)
Non-pure function example:
var annoyance = 0;
As you can see, he returns no value, needs none of my input, and changes a state (has side effects).
State is like glitter
We must be very careful when working with glitter. The motherfucker gets everywhere. State is like that, manage it carefully or you will end up contaminating your code. Nobody wants glitter flecks on their cheeks.