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
Bad Cocoa
Search
Delisa Mason
May 28, 2014
Programming
17k
12
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Bad Cocoa
How-to guide for building the kind of code you will deeply regret later
Delisa Mason
May 28, 2014
More Decks by Delisa Mason
See All by Delisa Mason
Pod for Great Good
kattrali
2
450
AppKit for iOS Developers
kattrali
5
900
Crafting iOS Dev Tools in Redcar, the Ruby Editor
kattrali
2
850
Other Decks in Programming
See All in Programming
AmebaブログはKMPから卒業します
kmars0605
0
210
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
3
450
AWSに止められる覚悟してますか?
morizo_1984
2
540
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
220
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
740
最近”作らせてる” ローカルAIアプリの話
akit37
0
480
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
320
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
180
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
4k
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
エンジニアに許された特別な時間の終わり
watany
109
250k
The browser strikes back
jonoalderson
0
1.8k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The Curse of the Amulet
leimatthew05
3
16k
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
540
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
Odyssey Design
rkendrick25
PRO
2
880
Typedesign – Prime Four
hannesfritz
42
3.2k
Transcript
Bad Cocoa How to write the code of deep regret
quickly and easily - @kattrali
Think Monolithic ensure changing one part of an app requires
changing them all
Long Selector is Best Selector
Test Private Stuff ensure every test will break during refactors
maximize the number of mocks, stubs, and performSelector() calls
Do Not Write Tests no worries, the compiler will catch
your bugs
Use Delegates with Callbacks If you don't need asynchronous callbacks
for synchronous code, you aren't trying hard enough -initWithDelegate:callback:
Subclass Subclass Subclass things will be easy when you need
to swap out superclasses sometime!
Categoriception Extend your own classes with several categories instead of
containing each unit of related functionality in a single class
Maximize Responsibilities Per Class ensure the difficulty of changing individual
components later
Safely assign many responsibilities using protocols @class MyController : NSObject
<MyControllerDelegate, Why, God, Please, Stop, WithTheProtocols>
Safely assign many responsibilities using protocols BONUS: Make each component
of a protocol optional, for maximum flexibility and verbosity (and less warnings!!)
Procrastinate on Performance always wait until you have a problem
before opening Instruments.app
if (@"Avoid Static Analysis") goto fail; goto fail;
Always Swing the Heaviest Hammer NSOperation and Core Data all
day every day - maximize boilerplate code (GCD and NSCoding don't real)
Make Code Styles Inconsistent increase the difficulty of using or
extending your project avoid code style tools like clang- format and Uncrustify
Do not write documentation especially avoid easy-to-use tooling like appledoc
Optimize early Reduce duplication as soon as possible, making code
less flexible later
When in doubt, add to AppDelegate There is no better
place to dump bits of code which do not belong anywhere and need access to application state certainly not new classes
#define over static variables get the most of your available
memory for your numbers, strings, and colors
Thank you!