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
SOLID/STUPID
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
GBProd
February 20, 2017
Programming
0
350
SOLID/STUPID
Base de cours autour des principes SOLID et STUPID
GBProd
February 20, 2017
Tweet
Share
More Decks by GBProd
See All by GBProd
Les tests en Symfony
gbprod
0
230
Make task runners great again
gbprod
2
330
Gilles, craftman from father to son
gbprod
0
170
DDD: Retour d'expérience
gbprod
0
42
Artisan développeur
gbprod
0
63
Other Decks in Programming
See All in Programming
ぼくの開発環境2026
yuzneri
1
290
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
1
340
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
210
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
3
350
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
120
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.2k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
130
ご飯食べながらエージェントが開発できる。そう、Agentic Engineeringならね。
yokomachi
1
270
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
790
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
410
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
13
7.4k
atmaCup #23でAIコーディングを活用した話
ml_bear
4
720
Featured
See All Featured
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
620
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
450
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
89
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
HDC tutorial
michielstock
1
480
Automating Front-end Workflow
addyosmani
1371
200k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
63
Build your cross-platform service in a week with App Engine
jlugia
234
18k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Become a Pro
speakerdeck
PRO
31
5.8k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
360
Transcript
STUPID Code ! Make it SOLID
STUPID Code ! Make it SOLID
Principles, not laws
You’re code is STUPID !
S T U P I D
S T U P I D ingleton
Global State
Hidden dependencies
But not impossible Difficult to test
S T U P I D ight coupling
Interaction level between components
Difficult to change
Difficult to reuse
Difficult to test
Avoiding “new”
S T U P I D ntestability
Everything must be easy to test
If you can’t test, the problem is about design
S T U P I D remature Optimization
Premature optimization is the root of all evil
Optimize only if it’s necessary
Optimize timely
Don’t do it (yet) !
Readability > Optimization
S T U P I D ndescriptive naming
Name properly
Names came from your domain
Don’t abbreviate
Don’t prefix/suffix
The length of a variable name should be proportional to
its scope. The length of a function or class name is the inverse.
“You should name a variable using the same care with
which you name a first-born child.”
Programming languages are for humans, not for computers
Code > Comments
Code = How
Tests = What
Comments = Why
S T U P I Duplication
Be lazy Don’t Repeat Yourself
Be lazy Don’t Repeat Yourself
Most of time Copy/Paste is bad
Use a Copy/Paste Detector
Make it SOLID plz !
S O L I D
S O L I D ingle responsability
Every class should have a single responsibility
Never be more than one reason for a class to
change
God classes
Don’t make your controller be God Objects
Avoid Mutators
Ask yourself what is class responsablity
Keep it as small as possible
S O L I D pen/Close
Open for extension, but closed for modification
extend > modify
setup > modify
S O L I D iskov substitution
Objects should be replaceable with instances of their subtypes without
altering the correctness of the program.
A square is NOT a rectangle
The mouse case
S O L I D nterface segregation
Many clients > One Generic Client
Don’t over-interface
S O L I Dependency injection
High level modules should not depend on low level modules.
Both should depend on abstractions.
Abstractions should not depend on details. Details should depend on
abstractions.
Be pragmatic
Exercice
git clone https://github.com/gbprod/solid-stupid.git