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
iOS Antipatterns - TDC 2014
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
hannelita
August 08, 2014
Technology
91
0
Share
iOS Antipatterns - TDC 2014
TDC 2014 - Sao Paulo
hannelita
August 08, 2014
More Decks by hannelita
See All by hannelita
Java EE 8 - Future, Wishes and Predictions
hannelita
1
220
JVM Internals Demystified
hannelita
0
370
Eletrônica
hannelita
0
190
Cassandra Meetup
hannelita
0
81
Our Daily Graphs written in Ruby and Neo4j
hannelita
1
190
Wildfly em alta disponibilidade
hannelita
0
270
Helios - o backend pra Mobile que você precisava <3
hannelita
0
130
Neo4j - Dia a dia com grafos, Neo4j e Ruby
hannelita
1
160
Swift - uma fama repentina
hannelita
1
150
Other Decks in Technology
See All in Technology
[最強DB講義]推薦システム | 評価編
recsyslab
PRO
0
110
Class.new is all you need
riseshia
1
180
AWS DevOps Agentはチームメイトになれるのか?/ Can AWS DevOps Agent become a teammate
kinunori
6
770
運用システムにおけるデータ活用とPlatform
sansantech
PRO
0
130
スクラムの中で AI-DLC workflow を 使い始めて3ヶ月の振り返り
kaminashi
0
130
Chasing Real-Time Observability for CRuby
whitegreen
0
260
生成AIが変える SaaS の競争原理と弁護士ドットコムのプロダクト戦略
bengo4com
1
2.3k
コミュニティ・勉強会を作るのは目的じゃない
ohmori_yusuke
0
260
AIでAIをテストする - 音声AIエージェントの品質保証戦略
morix1500
1
140
20260428_Product Management Summit_Loglass_JoeHirose
loglassjoe
3
3.8k
生成AI時代のドキュメントに対する期待の整理と実践から得た学び / Rethinking Documentation for LLM: Lessons from Practice
bitkey
PRO
1
100
基盤を育てる 外部SaaS連携の運用
gamonges_dresscode
1
120
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
150
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Being A Developer After 40
akosma
91
590k
Building Applications with DynamoDB
mza
96
7k
Designing Experiences People Love
moore
143
24k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
150
The Curse of the Amulet
leimatthew05
1
11k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
Amusing Abliteration
ianozsvald
1
160
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.2k
Transcript
iOS Antipatterns Tudo que você deveria fazer no seu código,
só que não.
Oi! • Hanneli (‘H' mudo) • CodeMiner 42 • Café,
Pokémon, Lego e bichos <3 HIRING
O que é um código ‘ruim'?
Por que escrevemos código ruim?
O que vamos ver aqui • Paradigma de programação -
sua importância • Princípios de OO que colaboram para um código ‘não ruim’ • Antipatternizando patterns • OSS - exemplos de antipatterns • GIFs engraçados (ou não)
O que *Não* vamos ver aqui • Aula chata de
OO • Introdução a Objective C / iOS / etc • Design Patterns • Aula sobre SOLID
Paradigma == modelo; padrão Toda vez que você padroniza algo,
você facilita na identificação e na produção
Orientação a Objetos == paradigma O que é OO? Herança
Polimorfismo Encapsulamento
O que é OO? “Passar Mensagem.”
OO para Objective C?
Colocando ordem na ‘troca de mensagens' SOLID
“Mantenha suas classes pequenas" Xiita de código bonito, 2014 https://github.com/robbiehanson/XMPPFramework/blob/
master/Core/XMPPStream.m
None
“1 classe, 1 responsabilidade” Xiita de código bonito, 2014 S
O L I D ingle Responsibility
Como melhorar? S O L I D ingle Responsibility •
Separar o controle dos bytes em outra classe • Separar o controle dos Events em outra classe • Separar a autenticação (!!11!!!)
“Cuidado com a herança" Xiita de código bonito, 2014 https://github.com/robbiehanson/XMPPFramework/blob/
a833c29e5b26cc3cca3d1f37490eed8ff5dd65e2/Extensions/ XEP-0009/XMPPIQ%2BJabberRPC.m
None
None
None
S O L I D pen closed
Como melhorar? • Interface comum - @protocol S O L
I D pen closed
Vamos falar sobre Design Patterns
Por que todo mundo fala em Design Patterns?
Singleton
Singleton - prós •Objeto pesado criado uma única vez! •Guarda
estado
Singleton - cons
Singleton - cons •Objetos pesados!
Singleton - Vilão ou mocinho? Use com moderação!
Decorator
Decorator https://github.com/robbiehanson/XMPPFramework/blob/ a833c29e5b26cc3cca3d1f37490eed8ff5dd65e2/Utilities/ DDList.m
None
Decorator
None
Decorator • Separar esses nodes • Associar os nodes
Conclusões • Dê uma melhorada no código! • Não precisa
usar design patterns o tempo todo, mas eventualmente ajuda • Dê uma revisada nos princípios de OO e SOLID! Quem for manter seu código agradece!
Obrigada! @hannelita
[email protected]