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
AI & Enginnering
codelynx
0
110
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
Fragmented Architectures
denyspoltorak
0
150
CSC307 Lecture 08
javiergs
PRO
0
670
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.8k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
780
CSC307 Lecture 09
javiergs
PRO
1
830
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
CSC307 Lecture 06
javiergs
PRO
0
680
Basic Architectures
denyspoltorak
0
660
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
ThorVG Viewer In VS Code
nors
0
770
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
97
How GitHub (no longer) Works
holman
316
140k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
430
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Darren the Foodie - Storyboard
khoart
PRO
2
2.3k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
110
Crafting Experiences
bethany
1
48
GitHub's CSS Performance
jonrohan
1032
470k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
77
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
320
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
170
Amusing Abliteration
ianozsvald
0
96
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