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
Alexandru Simonescu
June 17, 2016
Programming
0
95
!Smelly code - The origins
Some best practices we use to forget
Alexandru Simonescu
June 17, 2016
Tweet
Share
More Decks by Alexandru Simonescu
See All by Alexandru Simonescu
Software Architecture Journey
alxsimo
4
870
Serverless mobile applications with Firebase v2
alxsimo
4
260
Serverless mobile applications with Firebase
alxsimo
5
310
Cleaner code with Guava v2
alxsimo
5
520
Cleaner code with Guava
alxsimo
3
150
Low fat backends for mobile guys
alxsimo
0
110
GIT: what else?
alxsimo
1
120
Other Decks in Programming
See All in Programming
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
270
Basic Architectures
denyspoltorak
0
130
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
160
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
420
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
600
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
290
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
210
SwiftUIで本格音ゲー実装してみた
hypebeans
0
510
生成AIを利用するだけでなく、投資できる組織へ
pospome
2
410
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 2
philipschwarz
PRO
0
120
Cell-Based Architecture
larchanjo
0
150
開発に寄りそう自動テストの実現
goyoki
2
1.5k
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
34
Getting science done with accelerated Python computing platforms
jacobtomlinson
0
79
Into the Great Unknown - MozCon
thekraken
40
2.2k
Embracing the Ebb and Flow
colly
88
4.9k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
エンジニアに許された特別な時間の終わり
watany
106
220k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
170
Joys of Absence: A Defence of Solitary Play
codingconduct
1
260
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
73
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
320
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!