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
Life Without Footguns (Part 2)
Search
Chew Choon Keat
March 26, 2021
Programming
0
180
Life Without Footguns (Part 2)
Chew Choon Keat
March 26, 2021
Tweet
Share
More Decks by Chew Choon Keat
See All by Chew Choon Keat
Life Without Footguns (Part 1)
choonkeat
0
160
A Programmer’s Red Pill: Pure, Functional, and Typed
choonkeat
0
220
GraphQL for web devs who don't need it
choonkeat
1
220
TDD for people who don't need it
choonkeat
1
87
File Upload 2015
choonkeat
0
130
Other Decks in Programming
See All in Programming
実践!App Intents対応
yuukiw00w
1
330
The State of Fluid (2025)
s2b
0
190
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
460
モバイルアプリからWebへの横展開を加速した話_Claude_Code_実践術.pdf
kazuyasakamoto
0
240
Introduction to Git & GitHub
latte72
0
120
WebAssemblyインタプリタを書く ~Component Modelを添えて~
ruccho
1
900
未来を拓くAI技術〜エージェント開発とAI駆動開発〜
leveragestech
2
170
CEDEC 2025 『ゲームにおけるリアルタイム通信への QUIC導入事例の紹介』
segadevtech
3
960
バイブコーディングの正体——AIエージェントはソフトウェア開発を変えるか?
stakaya
5
1k
State of CSS 2025
benjaminkott
1
120
マイコンでもRustのtestがしたい その2/KernelVM Tokyo 18
tnishinaga
2
2.3k
Jakarta EE Core Profile and Helidon - Speed, Simplicity, and AI Integration
ivargrimstad
0
160
Featured
See All Featured
Speed Design
sergeychernyshev
32
1.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
Raft: Consensus for Rubyists
vanstee
140
7.1k
Embracing the Ebb and Flow
colly
87
4.8k
The Pragmatic Product Professional
lauravandoore
36
6.8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
890
It's Worth the Effort
3n
187
28k
4 Signs Your Business is Dying
shpigford
184
22k
Producing Creativity
orderedlist
PRO
347
40k
How STYLIGHT went responsive
nonsquared
100
5.7k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Building Adaptive Systems
keathley
43
2.7k
Transcript
Life Without Footguns @choonkeat March 2021
About • Basic • C, Perl, Java • Javascript &
Ruby on Rails for 10 years • Go and Elm in the past few years • @choonkeat
About • Basic • C, Perl, Java • Javascript &
Ruby on Rails for 10 years • Go and Elm in the past few years • @choonkeat How to do things How to NOT do things
Anyone happy with this? nope
Why is it common to see this? well…
It was clean when I started
Since data is all here, add a Method
A magnet to add more Method
Does every Method use all the data? nope
“You wanted a banana but what you got was a
gorilla holding the banana and the entire jungle.” — Joe Armstrong (Erlang) Funny quip
“You wanted to call the formatUserName method but you’d have
to wait for Zookeeper to boot and Kafka to connect” — Me Has costs
:. Method = Footgun banana-gorilla-jungle code is less maintainable and
less reusable
Write plain functions instead
A Function With Exact Arguments just the banana without gorilla
or jungle
A Good Thing ™ a function with exact arguments is
a maintainable and reusable unit of code
No Method = No Interface? But Interface is a Good
Thing ™, right?
❤ Interface is a Good Thing ™
Any Writer can “Write” 😘
Different Dependency Same “Write” 🥰
Can “interface” be a function?
But Different Dependency… 😖
Digression
Nobody: Functional programming articles: instead of add(3, 5) when
you curry, you can get add3(5) !!!11!!1 Digression
What’s “currying” actually good for
What’s “currying” actually good for
None
Call without that last argument…
Currying 🥘
Different Dependency Same “Write” sounds familiar?
Different Dependency Same “Write” sounds familiar?
Currying = Interface with Functions no wonder these functions are
always so simple. no ceremony to use
Implementing an “interface” is… hint: not method
sounds familiar? A Function With Exact Arguments
sounds familiar? A Function With Exact Arguments
A Good Thing ™ a function with exact arguments is
a maintainable and reusable unit of code