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
My talk on i4cup meetup
Search
vixentael
April 28, 2016
Programming
0
230
My talk on i4cup meetup
My talk on small local i4cup meetup. Telling about my Swift fuckup :)
vixentael
April 28, 2016
Tweet
Share
More Decks by vixentael
See All by vixentael
Building security into autonomous & robotic systems
vixentael
0
29
Using YubiKey and FIDO U2F for secure authentication
vixentael
0
2.4k
Data is a new security boundary
vixentael
0
7.1k
Cryptographic protection of ML models
vixentael
0
3.4k
e2ee != security != privacy
vixentael
0
2.5k
Maintaining cryptographic library for 12 languages
vixentael
1
4.4k
10 lines of encryption, 1500 lines of key management
vixentael
2
2k
Security, privacy and cryptography at WWDC19
vixentael
1
840
Data encryption: CyberKids edition
vixentael
0
740
Other Decks in Programming
See All in Programming
Android16 Migration Stories ~Building a Pattern for Android OS upgrades~
reoandroider
0
130
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
4
13k
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
240
Go言語はstack overflowの夢を見るか?
logica0419
0
520
チームの境界をブチ抜いていけ
tokai235
0
210
CSC305 Lecture 10
javiergs
PRO
0
220
Six and a half ridiculous things to do with Quarkus
hollycummins
0
210
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
190
contribution to astral-sh/uv
shunsock
0
500
エンジニアインターン「Treasure」とHonoの2年、そして未来へ / Our Journey with Hono Two Years at Treasure and Beyond
carta_engineering
0
410
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
870
AI Agent 時代的開發者生存指南
eddie
4
2.1k
Featured
See All Featured
BBQ
matthewcrist
89
9.8k
GraphQLとの向き合い方2022年版
quramy
49
14k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Embracing the Ebb and Flow
colly
88
4.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Navigating Team Friction
lara
190
15k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
A better future with KSS
kneath
239
18k
The Language of Interfaces
destraynor
162
25k
Transcript
i4☕
Code that smells aka ‘bydlo-code’
kill me, please
don’t write code that smells
None
there was a dev team…
there was a dev team… …writing on ObjC
and they decided to switch to Swift!
and they decided to switch to Swift! in production!
None
it was nice morning and PM decided to install app
it was nice morning and PM decided to install app
on device!
None
it’s not us! it’s new 7.3 Xcode!
oh no, it’s us :(
"loadData has not been implemented" found in logs
None
– loadData(…) -> … – loadData(…) -> … ChildTableViewController <T>
BaseTableViewController <T>
BaseTableViewController <T> – loadData(…) -> … ChildTableViewController <T> – loadData(…)
-> … generics stub overriden
BaseTableViewController <T> – loadData(…) -> … ChildTableViewController <T> – loadData(…)
-> … generics stub overriden not called at all
A – architecture
Problem solving
What if we disable optimization?
let’s disable optimization..
too many optimizations! swift compiler optimization!
Why debug is ok?
…Testability
Debug Release Optimization Testability WMO yes WMO no
WMO https://developer.apple.com/swift/blog/?id=27 if method has no ‘internal’ access, compiler may
mark it as ‘final’
Testability allows you to use all ‘internal’ methods in tests
like ‘public’
everything is ok overriden methods may be lost Debug Release
Optimization Testability WMO yes WMO no
tweet all the things!
tweet all the things!
sudden help!
sudden help! swift contributor
https://gist.github.com/PaulTaykalo/5c97010874a93626ca3c Minimal crashable code
http://openradar.appspot.com/radar?id=4971716266688512 Filed Radar
SIL devirtualization: Conservatively avoid filtering devirt candidates on generic base
classes Fix by @jckarter https://github.com/apple/swift/pull/1954
SIL devirtualization: Conservatively avoid filtering devirt candidates on generic base
classes Fix by @jckarter https://github.com/apple/swift/pull/1954
Fix by @jckarter fix! https://github.com/apple/swift/pull/1954
Tests https://github.com/apple/swift/pull/1954
Swift 2.2 Patch https://github.com/apple/swift/pull/1954
Lessons learnt
Lesson #1 every decision has consequences
sooner or later they’ll appear Lesson #1 every decision has
consequences
Lesson #2 always try build in release on device
at least once a day Lesson #2 always try build
in release on device
and community Lesson #3 twitter rulez
Lesson #4 PMs are useful
sometimes Lesson #4 PMs are useful
team: Vitaliy, Igor, Paul Thanks community: @akosma, @jckarter PM: Anna
None