Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
What's Up With Swift
Search
Mert Dumenci
December 14, 2014
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
What's Up With Swift
NSIstanbul Meetup 1.4
Mert Dumenci
December 14, 2014
Transcript
46 slides
What’s up with Swift? $ diff Objective-C Swift
“Objective-C without the C”
“Objective-C without the C” A new language
Objective-C is heavily influenced by Smalltalk Objective-C is based on
messaging Objective-C is reflective
Swift is not heavily influenced by Smalltalk Swift is not
based on messaging Swift is limited in reflection
<objc/runtime.h>
objc_msgSend
Objective-C is dynamic (fun!) and safe enough by design
Swift is static and safe by design
Objective-C relies on the runtime for a lot of things
This makes it flexible But also hard to statically analyse
Swift relies on the compiler for a lot of things
This makes it not so flexible But also easy to statically analyse
Swift is not just a changed syntax
It’s a philosophy change
Swift is safe
Swift is concise
Swift is multi paradigm
Objective-C nil eats messages
There’s usually no need for explicit value existence checks
If nil means non-existent, so how do you represent existent
keys with no value in hashes?
[NSNull null]
@property (nonatomic, retain) NSMutableArray *array; [self.array addObject:@1]; NSNumber *value =
self.array.firstObject; Why is value nil?
nil, NSNull, silent failure
Optionals
enum Optional<T> { case None case Some(T) }
None
None
None
Type inference
let name = “Mert" let cities = ["Istanbul": 14_160_167, "Copenhagen":
559_557, "Tokyo": 13_350_000] let image = UIImage(named: "NSIstanbul")
Generics
None
func map<T, U>(array: [T], transform: (T) -> U) -> [U]
Theorems for free! Philip Wadler
Mutability as a language feature
Value types
First class functions
Pattern matching
…and many more
Swift is modern
Thanks
@mertdumenci
A lot of this presentation is from Functional Programming in
Swift — read it!
Couple of things
Objective-C is still a super awesome language, and it’s not
going anywhere anytime soon. It’s still incredibly relevant.
Swift is a concise and clean language. This doesn’t mean
it’s similar to JavaScript in any way. Don’t write JavaScript in Swift.
Swift has a long way to go. If you need
good reliability, use Objective-C.
Other Decks in Programming
See All in Programming
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
330
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
160
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
320
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
750
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
2
440
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
620
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
130
protojson における文字化けの扱い
kazuki1023
0
430
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
130
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
350
はじめてのPLATEAU
nokonoko1203
1
650
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
210
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
570
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
460
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
How STYLIGHT went responsive
nonsquared
100
6.4k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
840
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
4 Signs Your Business is Dying
shpigford
187
23k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
850
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
310
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k