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
!Smelly code - The origins
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Alexandru Simonescu
June 17, 2016
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
!Smelly code - The origins
Some best practices we use to forget
Alexandru Simonescu
June 17, 2016
More Decks by Alexandru Simonescu
See All by Alexandru Simonescu
Software Architecture Journey
alxsimo
4
900
Serverless mobile applications with Firebase v2
alxsimo
4
280
Serverless mobile applications with Firebase
alxsimo
5
320
Cleaner code with Guava v2
alxsimo
5
540
Cleaner code with Guava
alxsimo
3
160
Low fat backends for mobile guys
alxsimo
0
130
GIT: what else?
alxsimo
1
130
Other Decks in Programming
See All in Programming
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
500
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
150
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
7.8k
VibeCodingからAgenticWorkflowへ
starfish719
0
870
Introducing Stack Pull Request in GitHub
kkamegawa
0
100
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
390
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
230
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
620
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
720
バグを直したら useEffect が消えた
colorful12
3
700
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
210
初めての模倣学習とVLA
natsutan
0
250
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
11
39k
The Language of Interfaces
destraynor
162
27k
The browser strikes back
jonoalderson
0
1.5k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
250
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
Fireside Chat
paigeccino
42
4k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
220
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Speed Design
sergeychernyshev
33
2k
Done Done
chrislema
186
16k
Transcript
!smelly_code clean development @alexsimonescu
Coach better than teach
N-Layered Domain Oriented Architecture Guide
SOLID
what’s next?
GRASP
General Responsibility Assignment Software Patterns
(High cohesion) && (Low coupling)
Cohesion
High Cohesion - Methods of a class have much in
common
High Cohesion - Methods of a class have much in
common - Methods focus on same functionality
High Cohesion - Methods of a class have much in
common - Methods focus on same functionality - Higher cohesion between elements = better
High Cohesion - Methods of a class have much in
common - Methods focus on same functionality - Higher cohesion between elements = better - Lower cohesion can be disturbing; but not critical
Cohesion Types
Functional Cohesion Small units, work together and share same intention
/ function
Sequencial Cohesion Output of an element, serves as input for
another one
Informational Cohesion Different modules work with same data object
Procedural Cohesion Elements are grouped together in order to sequentially
execute a task
Temporal Cohesion Elements are executed at same moment of time
Logical Cohesion Logical elements are put together in same module
Loose Coupling
Loose coupling - Increase reusability
Loose coupling - Increase reusability - Low colateral effect when
changing collaborators
Patterns
Reuse / release equivalence - Libraries
Reuse / release equivalence - Libraries - You are the
consumer
Reuse / release equivalence - Libraries - You are the
consumer - You should not need to look at source code
Reuse / release equivalence - Libraries - You are the
consumer - You should not need to look at source code - Take care with semantic versioning
Common reuse principle - Tells how to organize packages
Common reuse principle - Tells how to organize packages -
The classes on a package are reused together
Common reuse principle - Tells how to organize packages -
The classes on a package are reused together - If you reuse one class from the package, you should reuse all
Acyclic dependencies - The dependency graph between packages should be
direct
Acyclic dependencies - The dependency graph between packages should be
direct - There must not be any cycles
Smells
Compound names
Long names
Comments
Long parameters list
Duplicated code
Conditional complexity
Large classes
Dead code
Temporary fields
Crime scene
Crime scene
Code Maat
Code Maat
None
None
None
Find the boss
Use cases
MVC
MVC
MVP
MVP
MVVM
MVVMP
Clean Architecture
None
None
None
None
Hexagonal
None
None
None
Thanks!