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
200
0
Share
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
180
A Programmer’s Red Pill: Pure, Functional, and Typed
choonkeat
0
250
GraphQL for web devs who don't need it
choonkeat
1
240
TDD for people who don't need it
choonkeat
1
110
File Upload 2015
choonkeat
0
150
Other Decks in Programming
See All in Programming
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
250
Claude Code Skill入門
mayahoney
0
460
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1.3k
20260315 AWSなんもわからん🥲
chiilog
2
180
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
230
Claude Codeログ基盤の構築
giginet
PRO
7
3.8k
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
1
230
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1.3k
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
210
Radical Imagining - LIFT 2025-2027 Policy Agenda
lift1998
0
110
「速くなった気がする」をデータで疑う
senleaf24
0
130
おれのAgentic Coding 2026/03
tsukasagr
1
130
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
340
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
190
Measuring & Analyzing Core Web Vitals
bluesmoon
9
800
Designing for Performance
lara
611
70k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
170
Prompt Engineering for Job Search
mfonobong
0
250
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
HDC tutorial
michielstock
1
600
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
27
3.4k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
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