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
110
0
Share
!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
880
Serverless mobile applications with Firebase v2
alxsimo
4
270
Serverless mobile applications with Firebase
alxsimo
5
320
Cleaner code with Guava v2
alxsimo
5
530
Cleaner code with Guava
alxsimo
3
160
Low fat backends for mobile guys
alxsimo
0
120
GIT: what else?
alxsimo
1
130
Other Decks in Programming
See All in Programming
PHPでローカル環境用のSSL/TLS証明書を発行することはできるのか? #phpconkagawa
akase244
0
290
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
160
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
1.4k
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
160
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
AIと共に生きる技術選定 2026
sgash708
0
120
Spec-driven Development: How AI Changes Everything (And Nothing)
simas
PRO
0
570
How Swift's Type System Guides AI Agents
koher
0
320
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
140
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1k
AIを導入する前にやるべきこと
negima
2
320
実践CRDT
tamadeveloper
0
610
Featured
See All Featured
Building Adaptive Systems
keathley
44
3k
How to train your dragon (web standard)
notwaldorf
97
6.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Heart Work Chapter 1 - Part 1
lfama
PRO
6
35k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
780
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
530
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Context Engineering - Making Every Token Count
addyosmani
9
860
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
190
What's in a price? How to price your products and services
michaelherold
247
13k
Writing Fast Ruby
sferik
630
63k
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!