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
clean code: four rules of simple design
Search
Avinash Chugh
May 31, 2014
Programming
5
1.2k
clean code: four rules of simple design
the slide deck used for an internal design/programming workshop for developers.
Avinash Chugh
May 31, 2014
Tweet
Share
More Decks by Avinash Chugh
See All by Avinash Chugh
Platform Thinking - Bringing Agility to Business
avinashchugh
0
27
Embracing the changing technology paradigms
avinashchugh
0
25
product thinking is problem solving.
avinashchugh
0
140
The anatomy of a platform.
avinashchugh
0
110
Evolutionary Enterprise Architectures
avinashchugh
0
55
Continuous Delivery in Motion
avinashchugh
0
120
seven tips to effective writing
avinashchugh
0
220
micro services, yotta benefits
avinashchugh
1
180
managing build artifacts with nexus
avinashchugh
0
81
Other Decks in Programming
See All in Programming
バリデーションライブラリ徹底比較
nayuta999999
1
550
Devinで実践する!AIエージェントと協働する開発組織の作り方
masahiro_nishimi
6
2.8k
UPDATEがシステムを複雑にする? イミュータブルデータモデルのすすめ
shimomura
0
400
"使いづらい" をリバースエンジニアリングする UI の読み解き方
rebase_engineering
0
120
ts-morph実践:型を利用するcodemodのテクニック
ypresto
1
580
イベントストーミングから始めるドメイン駆動設計
jgeem
3
720
バランスを見極めよう!実装の意味を明示するための型定義 TSKaigi 2025 Day2 (5/24)
whatasoda
2
810
Babylon.js 8.0のアプデ情報を 軽率にキャッチアップ / catch-up-babylonjs-8
drumath2237
0
120
がんばりすぎないコーディングルール運用術
tsukakei
1
210
漸進。
ssssota
0
1.5k
実はすごいスピードで進化しているCSS
hayato_yokoyama
0
100
2度もゼロから書き直して、やっとブラウザでぬるぬる動くAIに辿り着いた話
tomoino
0
120
Featured
See All Featured
Practical Orchestrator
shlominoach
188
11k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
What's in a price? How to price your products and services
michaelherold
245
12k
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.7k
How STYLIGHT went responsive
nonsquared
100
5.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.6k
Embracing the Ebb and Flow
colly
85
4.7k
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Transcript
1 CLEAN CODE Four rules for simple design, according to
Kent Beck
WHO IS KENT BECK? 2 +Agile Manifesto +JUnit
IS TDD DEAD? 3
THE PURSUIT OF SIMPLICITY 4 Do the simplest thing that
could possibly work
5 RULE 1 - ALL TESTS MUST PASS ! Program
correctness Feedback loops Confidence levels Ease of evolution Working specification ! !
THE PYRAMID OF TESTING 6 Unit tests Integration tests Functional
tests The higher we go ! ▫︎fewer numbers ▫︎slower feedback ▫︎higher cost
7 ! ! Duplication is waste Eliminate waste Say it
once, Say it well Less code means fewer bugs ! ! RULE 2 - ONCE AND ONLY ONCE (OOO)
RULE 3 - EXPRESS YOUR INTENT 8 ! All in
the name Staying small Role playing Tell, don’t ask The world as we see it
9 ! ! ! Would you really need this? (minimal
methods, classes, & modules) RULE 4 - NO SUPERFLUOUS PARTS
FORM VS. FUNCTION 10
ENDLESS POSSIBILITIES 11
12 YOU AIN’T GONNA NEED IT! ! ! The world
is changing. fast. Build for what you know. Over time, you’ll know more. What if I could look ahead?
LISTEN TO THE CODE 13 ! ! 1. Write a
test, make it pass, refactor 2. Refactor to the point of simplicity 3. Listen to the code
THE SIMPLE DESIGN DYNAMO TM 14
SUMMARY 15 ! ! 1. All tests must pass 2.
Don’t repeat yourself 3. Express your intent 4. Stay lean
For questions or suggestions: ! Avinash Chugh avinashc@thoughtworks.com THANK YOU
REFERENCES 17 ! ! 1. http://c2.com/cgi/wiki?XpSimplicityRules 2. http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/ 0132350882 3.
http://math.ucr.edu/home/baez/physics/General/occam.html 4. http://blog.thecodewhisperer.com/2013/12/07/putting-an-age-old-battle-to-rest/