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
720
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
32
iOS Architecture & Pattern
jukiginanjar
0
39
Other Decks in Programming
See All in Programming
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
160
エンターテイメント業界で利用されるAWS
demuyan
0
180
Swiftの型推論を学ぼう | Let's Learn About Type Inference in Swift
omochi
3
3.3k
The Future of C++ Interoperability: Insights from Porting a Game to Swift
teamhimeh
0
550
Why 1 + 1 = 2 in Swift?
1plus4
1
590
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
950
Javaエンジニアのための Nodejs/Nuxt3入門
hidekatsu_izuno
0
250
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
33
15k
オブジェクトしこう
okuramasafumi
2
150
[SF Ruby, March 2024] Rails on Wasm
palkan
0
360
入門 AWS Amplify Gen2 / Introduction to AWS Amplify Gen2
genkiogasawara
1
290
Introduction for Open Source Swift Workshop
giginet
PRO
0
1k
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.8k
A Philosophy of Restraint
colly
195
16k
What's in a price? How to price your products and services
michaelherold
237
11k
How STYLIGHT went responsive
nonsquared
92
4.8k
Unsuck your backbone
ammeep
662
57k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
13
1.5k
4 Signs Your Business is Dying
shpigford
175
21k
The Brand Is Dead. Long Live the Brand.
mthomps
48
26k
Designing the Hi-DPI Web
ddemaree
275
33k
jQuery: Nuts, Bolts and Bling
dougneiner
58
7.1k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Raft: Consensus for Rubyists
vanstee
130
6.2k
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