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
技術同人誌をMCP Serverにしてみた
74th
1
630
Hack Claude Code with Claude Code
choplin
2
830
Result型で“失敗”を型にするPHPコードの書き方
kajitack
5
610
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
2
630
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
2
150
A full stack side project webapp all in Kotlin (KotlinConf 2025)
dankim
0
110
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
180
すべてのコンテキストを、 ユーザー価値に変える
applism118
3
1.2k
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
16
11k
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
750
VS Code Update for GitHub Copilot
74th
2
630
Discover Metal 4
rei315
2
130
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Speed Design
sergeychernyshev
32
1k
Building Adaptive Systems
keathley
43
2.7k
Practical Orchestrator
shlominoach
188
11k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Optimizing for Happiness
mojombo
379
70k
Done Done
chrislema
184
16k
What's in a price? How to price your products and services
michaelherold
246
12k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
Testing 201, or: Great Expectations
jmmastey
42
7.6k
Documentation Writing (for coders)
carmenintech
72
4.9k
Statistics for Hackers
jakevdp
799
220k
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