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
Codex の「自走力」を高める
yorifuji
0
1.2k
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
750
Claude Codeログ基盤の構築
giginet
PRO
7
3.3k
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
240
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
140
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
550
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
160
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
270
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
180
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
140
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
490
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
410
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
140
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
Being A Developer After 40
akosma
91
590k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
480
Making Projects Easy
brettharned
120
6.6k
Building Adaptive Systems
keathley
44
3k
My Coaching Mixtape
mlcsv
0
72
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
480
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Tell your own story through comics
letsgokoyo
1
840
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.7k
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