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
97
!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
880
Serverless mobile applications with Firebase v2
alxsimo
4
260
Serverless mobile applications with Firebase
alxsimo
5
310
Cleaner code with Guava v2
alxsimo
5
530
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
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
140
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
120
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
150
猫の手も借りたい!ので AIエージェント猫を作って社内に放した話 Claude Code × Container Lambda の Slack Bot "DevNeko"
naramomi7
0
250
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
240
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
340
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
110
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
450
CSC307 Lecture 12
javiergs
PRO
0
460
atmaCup #23でAIコーディングを活用した話
ml_bear
4
740
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
470
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
1k
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Deep Space Network (abreviated)
tonyrice
0
86
Automating Front-end Workflow
addyosmani
1370
200k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
140
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
140
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Evolving SEO for Evolving Search Engines
ryanjones
0
150
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Optimizing for Happiness
mojombo
378
71k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
280
Become a Pro
speakerdeck
PRO
31
5.8k
The agentic SEO stack - context over prompts
schlessera
0
680
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!