Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Life Without Footguns (Part 2)
Search
Chew Choon Keat
March 26, 2021
Programming
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Life Without Footguns (Part 2)
Chew Choon Keat
March 26, 2021
More Decks by Chew Choon Keat
See All by Chew Choon Keat
Life Without Footguns (Part 1)
choonkeat
0
200
A Programmer’s Red Pill: Pure, Functional, and Typed
choonkeat
0
270
GraphQL for web devs who don't need it
choonkeat
1
250
TDD for people who don't need it
choonkeat
1
110
File Upload 2015
choonkeat
0
160
Other Decks in Programming
See All in Programming
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
920
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
270
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
200
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
520
Vue Fes Japan の “作る側”に関わってみて
naokihaba
1
180
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
3
1.1k
golang-bob.pdf
iwatsukayura
0
140
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.8k
気持ちぃ〜角丸 Squircle
ryu1013
0
330
[2026-10-14](C)Re:ゼロから始める異世界生活〜始まりの終わりと終わりの始まり〜
tosite
0
150
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.4k
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
120
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Skip the Path - Find Your Career Trail
mkilby
1
260
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Test your architecture with Archunit
thirion
2
2.5k
A designer walks into a library…
pauljervisheath
211
25k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Done Done
chrislema
187
17k
Facilitating Awesome Meetings
lara
57
7.2k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Code Review Best Practice
trishagee
74
20k
Building the Perfect Custom Keyboard
takai
2
920
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