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
Swift - Protocol oriented programming
Search
Nanang Rafsanjani
September 25, 2015
Programming
0
750
Swift - Protocol oriented programming
Perkenalan Swift - Protocol oriented programming
Nanang Rafsanjani
September 25, 2015
Tweet
Share
More Decks by Nanang Rafsanjani
See All by Nanang Rafsanjani
Introduction to Realm
jukiginanjar
0
42
iOS Architecture & Pattern
jukiginanjar
0
45
Other Decks in Programming
See All in Programming
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
340
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
240
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
160
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
110
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
350
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
2
380
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.3k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
530
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
140
Codex の「自走力」を高める
yorifuji
0
1.2k
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
510
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
340
Featured
See All Featured
Building an army of robots
kneath
306
46k
Everyday Curiosity
cassininazir
0
160
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.3k
Designing Experiences People Love
moore
143
24k
Embracing the Ebb and Flow
colly
88
5k
We Have a Design System, Now What?
morganepeng
55
8k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
300
Rails Girls Zürich Keynote
gr2m
96
14k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
76
Discover your Explorer Soul
emna__ayadi
2
1.1k
Transcript
Protocol Oriented Programming in Swift
"Crusty" is an old-school programmer who doesn't trust IDE's, debuggers
and he doesn’t do OOP
Classes are Awesome • Encapsulation • Access Control • Abstraction
• Namespace • Expressive Syntax • Extensibility
Classes are Awesome • Encapsulation • Access Control • Abstraction
• Namespace • Expressive Syntax • Extensibility You can do all that with structs and enums!
Classes are Awesome Inheritance
Classes are Awesome Inheritance
Classes are Awesome Inheritance
Crusty's 3 complaints about classes 1. Implicit sharing 2. Inheritance
is too intrusive 3. Lost type relationships
Implicit Sharing
Implicit Sharing
Implicit Sharing
Inheritance too intrusive • You can only have 1 super
class • Bloating your super class • If superclass have stored properties ◦ You have to accept them, which bloat it ◦ You have to initialize it ◦ Make sure that you understand how to interact with your superclass
Lost Type Relationships
Protocol Solves the Problems