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
Bad Cocoa
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Delisa Mason
May 28, 2014
Programming
17k
12
Share
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
440
AppKit for iOS Developers
kattrali
5
880
Crafting iOS Dev Tools in Redcar, the Ruby Editor
kattrali
2
820
Other Decks in Programming
See All in Programming
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
100
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
390
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
200
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.1k
実用!Hono RPC2026
yodaka
2
300
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
490
AIを導入する前にやるべきこと
negima
2
340
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
320
【26新卒研修資料】TDD実装演習
dip_tech
PRO
0
170
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
540
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
2.9k
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
1.6k
Featured
See All Featured
Deep Space Network (abreviated)
tonyrice
0
130
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
We Are The Robots
honzajavorek
0
220
For a Future-Friendly Web
brad_frost
183
10k
The World Runs on Bad Software
bkeepers
PRO
72
12k
AI: The stuff that nobody shows you
jnunemaker
PRO
6
630
The untapped power of vector embeddings
frankvandijk
2
1.7k
Leo the Paperboy
mayatellez
7
1.7k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
130
How to make the Groovebox
asonas
2
2.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
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!