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
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
39
iOS Architecture & Pattern
jukiginanjar
0
44
Other Decks in Programming
See All in Programming
Catch Up: Go Style Guide Update
andpad
0
230
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
390
Foundation Modelsを実装日本語学習アプリを作ってみた!
hypebeans
0
110
CSC305 Lecture 04
javiergs
PRO
0
270
高度なUI/UXこそHotwireで作ろう Kaigi on Rails 2025
naofumi
4
4.1k
そのpreloadは必要?見過ごされたpreloadが技術的負債として爆発した日
mugitti9
2
3.4k
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1.1k
Le côté obscur des IA génératives
pascallemerrer
0
140
理論と実務のギャップを超える
eycjur
0
130
Devvox Belgium - Agentic AI Patterns
kdubois
1
120
overlayPreferenceValue で実現する ピュア SwiftUI な AdMob ネイティブ広告
uhucream
0
180
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
3
180
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
697
190k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
The Cost Of JavaScript in 2023
addyosmani
55
9k
Navigating Team Friction
lara
190
15k
BBQ
matthewcrist
89
9.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
GraphQLとの向き合い方2022年版
quramy
49
14k
Embracing the Ebb and Flow
colly
88
4.8k
Context Engineering - Making Every Token Count
addyosmani
6
240
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