$30 off During Our Annual Pro Sale. View Details »
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
740
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
41
iOS Architecture & Pattern
jukiginanjar
0
45
Other Decks in Programming
See All in Programming
認証・認可の基本を学ぼう後編
kouyuume
0
240
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
160
これならできる!個人開発のすゝめ
tinykitten
PRO
0
110
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
170
WebRTC と Rust と8K 60fps
tnoho
2
2k
Cap'n Webについて
yusukebe
0
130
俺流レスポンシブコーディング 2025
tak_dcxi
14
8.8k
Developing static sites with Ruby
okuramasafumi
0
290
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
160
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
140
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
38
26k
ゲームの物理 剛体編
fadis
0
350
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
730
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Building Adaptive Systems
keathley
44
2.9k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
100
How GitHub (no longer) Works
holman
316
140k
Git: the NoSQL Database
bkeepers
PRO
432
66k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
The Cult of Friendly URLs
andyhume
79
6.7k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Agile that works and the tools we love
rasmusluckow
331
21k
Embracing the Ebb and Flow
colly
88
4.9k
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