If you already know FP you will find it too basic :( If it is the first time that you hear about FP I would like you to feel curious about it by the end of this talk. If you think that FP is too hard I would like you to feel less scared by it by the end of this talk.
It is hard because there are a lot of new terms and it is a different way of thinking.
OOP once also was a different way of thinking and had a lot of terms and today you know it well :)
Functional programing jargon
A DublinJS lighting talk by Remo H. Jansen
The functional programming jargon is “scary”!
● Function arity
● Pure functions
● Referential transparency
● Side effects
● Partial application
● Function Composition
● Lazy evaluation
Fear not my friends!
Do you remember how you felt the first time you encountered the Object-oriented jargon?
Purity (AKA referential transparency) means “every time you pass the same inputs, you
always get the same outputs”.
A pure function is free of side effects. A side effect refers simply to
the modification of some kind of state.
Any operation which modifies the state of the computer or which
interacts with the outside world is said to have a side effect.
objects are not immutable and our pure functions should avoid mutating its arguments (side
Function Partial Application
Partial application is the process of fixing a number of arguments to a function, producing
another function of smaller arity.
Arity refers to the number of arguments a function can accept. This
might be none, one (unary), two (binary) or more (polyadic). You
can also have functions that take a variable number of arguments,
Currying is the process of taking a function that accepts N arguments and turning it into a
chained series of N functions each taking 1 argument.
The act or mechanism of combining simple functions to build more complicated ones.
Unary functions are easier to compose. Currying helps us to perform function composition.
Functional programming manages complexity via composition as opposed to data encapsulation.
How to learn more?
● Reactive Programming with RxJS by Sergi Mansilla
● React & Redux