2. FUNCTIONAL THINKING
MOST IMPORTANT THING
▸ OO makes code understandable by encapsulating moving parts. FP makes
code understandable by minimizing moving parts - Micael Feathers
3.
4. FUNCTIONAL THINKING
OBJECT ORIENTED PROGRAMMING
▸ Object based
▸ Object = filed (variable) + method (function)
▸ Method makes ‘return value’ with internal variable in object.
5. FUNCTIONAL THINKING
FUNCTIONAL PROGRAMMING
▸ Function based
▸ Function is same in C
▸ Function does not use external variable without parameters.
▸ function’s output is always f(x…)
6. FUNCTIONAL THINKING
LAMBDA
▸ advanced function in computer science.
▸ normal function f1(x, y) = z
identity function f2(x)
▸ High-order function : f1(x, y) = z -> f1(f2(x), y) = z
▸ Curring : f1(x, y) = z, f1(z, y) = a -> f1(f1(x, y), y) = a
7. THE REASON WHY WE SHOULD DO
FUNCTIONAL PROGRAMMING IS….
Neal Ford
FUNCTIONAL THINKING
9. FUNCTIONAL THINKING
SIMPLE
▸ Method : running
▸ in OOP
▸ The implements of running method is depend on the kind of subclasses.
MEN’S RUNNING DOG’S RUNNING BIRD’S RUNNING
ANIMAL’S RUNNING
10. FUNCTIONAL THINKING
SIMPLE
▸ Method : running
▸ FP
▸ The running function is independent.
▸ The running function does not have any data.
▸ It makes risks minimized in FP.
‘MEN’ ‘DOG’ ‘BIRD’
FUNCTION RUNNING
(ANIMAL)