$30 off During Our Annual Pro Sale. View Details »
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
93
!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
860
Serverless mobile applications with Firebase v2
alxsimo
4
250
Serverless mobile applications with Firebase
alxsimo
5
300
Cleaner code with Guava v2
alxsimo
5
520
Cleaner code with Guava
alxsimo
3
150
Low fat backends for mobile guys
alxsimo
0
100
GIT: what else?
alxsimo
1
120
Other Decks in Programming
See All in Programming
Microservices rules: What good looks like
cer
PRO
0
1.1k
dotfiles 式年遷宮 令和最新版
masawada
1
740
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
590
React Native New Architecture 移行実践報告
taminif
1
150
社内オペレーション改善のためのTypeScript / TSKaigi Hokuriku 2025
dachi023
1
560
AIコーディングエージェント(Manus)
kondai24
0
160
CSC305 Lecture 17
javiergs
PRO
0
340
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
790
Level up your Gemini CLI - D&D Style!
palladius
1
180
20 years of Symfony, what's next?
fabpot
2
350
AWS CDKの推しポイントN選
akihisaikeda
1
240
FluorTracer / RayTracingCamp11
kugimasa
0
220
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Into the Great Unknown - MozCon
thekraken
40
2.2k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
700
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Become a Pro
speakerdeck
PRO
31
5.7k
Site-Speed That Sticks
csswizardry
13
990
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Building an army of robots
kneath
306
46k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
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!