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
1
35
Functional Programming Principles
Talk about core principles of functional programming
Alfin S.
December 22, 2023
Tweet
Share
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
14k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
17
950
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Facilitating Awesome Meetings
lara
54
6.4k
Designing for Performance
lara
609
69k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Code Reviewing Like a Champion
maltzj
524
40k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
124
52k
GitHub's CSS Performance
jonrohan
1031
460k
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)