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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
GBProd
February 20, 2017
Programming
370
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SOLID/STUPID
Base de cours autour des principes SOLID et STUPID
GBProd
February 20, 2017
More Decks by GBProd
See All by GBProd
Les tests en Symfony
gbprod
0
240
Make task runners great again
gbprod
2
330
Gilles, craftman from father to son
gbprod
0
180
DDD: Retour d'expérience
gbprod
0
49
Artisan développeur
gbprod
0
73
Other Decks in Programming
See All in Programming
Agentic UI
manfredsteyer
PRO
0
190
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
730
Oxcを導入して開発体験が向上した話
yug1224
4
330
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
170
OSもどきOS
arkw
0
580
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
220
A2UI という光を覗いてみる
satohjohn
1
150
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
7.6k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
370
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
220
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Heart Work Chapter 1 - Part 1
lfama
PRO
7
36k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
950
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
200
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
210
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
170
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
240
How to Ace a Technical Interview
jacobian
281
24k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
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