Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Functional Programming Principles
Search
Alfin S.
December 22, 2023
54
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Functional Programming Principles
Talk about core principles of functional programming
Alfin S.
December 22, 2023
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
230
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
660
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
320
The Art of Programming - Codeland 2020
erikaheidi
57
14k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
590
We Have a Design System, Now What?
morganepeng
55
8.3k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
The untapped power of vector embeddings
frankvandijk
2
1.9k
Unsuck your backbone
ammeep
672
58k
Abbi's Birthday
coloredviolet
3
9.8k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Rails Girls Zürich Keynote
gr2m
96
14k
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)