Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Functional Programming Principles
Search
Alfin S.
December 22, 2023
1
40
Functional Programming Principles
Talk about core principles of functional programming
Alfin S.
December 22, 2023
Tweet
Share
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Building Applications with DynamoDB
mza
96
6.8k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Navigating Team Friction
lara
191
16k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
The Cult of Friendly URLs
andyhume
79
6.7k
YesSQL, Process and Tooling at Scale
rocio
174
15k
We Have a Design System, Now What?
morganepeng
54
7.9k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Designing for Performance
lara
610
69k
Making Projects Easy
brettharned
120
6.5k
Transcript
Functional λ programming-principles Alfin Surya (@natserract)
Outline Introduction What is functional programming? Imperative vs Functional FP
Characteristics
What’s up! Hello! I’m Alfin I write JavaScript, Python, Elixir
FP enthusiast I also like to study AI & machine learning
Functional Programming?
Function Composition
imperative vs λ
imperative functional
Think Different(ly) They must be very small They must do
one thing only (single responsibility principle) They must have few arguments as possible (rules of three) They should not have side effects They should avoid flag arguments that create two internal paths in a function
FP Characteristics First-Class Functions Statelessness and Immutability Pure Functions Higher-Order
Functions
First-Class Functions Functions are treated as first-class citizens, meaning they
can be assigned to variables, passed as arguments, or returned from other functions.
Statelessness and Immutability Line 2: Attempt to assign to const
or readonly variable
Pure Function ✅ Deterministic ✅ No Side Effects
Impure function ❌ Deterministic ❌ No Side Effects
Higher Order Function
Advantages Modularity Testability Scalability Readability
Slides & More https://speakerdeck.com/natserract https://medium.com/@natserract https://github.com/natserract
Thanks! Alfin Surya (@natserract)