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.1k
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
24
Embracing the changing technology paradigms
avinashchugh
0
17
product thinking is problem solving.
avinashchugh
0
120
The anatomy of a platform.
avinashchugh
0
91
Evolutionary Enterprise Architectures
avinashchugh
0
52
Continuous Delivery in Motion
avinashchugh
0
110
seven tips to effective writing
avinashchugh
0
160
micro services, yotta benefits
avinashchugh
1
170
managing build artifacts with nexus
avinashchugh
0
58
Other Decks in Programming
See All in Programming
dbtのドメイン分割による データ基盤の改善とDigdagとの連携
sakama
0
480
新宿ダンジョンを可視化してみた
satoshi7190
3
420
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
480
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
430
Ruby Function Composition
bkuhlmann
1
340
slow types ってなんだろう?
karad
0
180
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
450
大規模UIKitベースアプリへのTCAの段階的導入/gradual-adoption-of-tca-in-a-large-scale-uikit-based-app
takehilo
2
210
AppRouter Panel Talk
yosuke_furukawa
PRO
1
500
Timeline エディター拡張入門
yucchiy
0
290
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
920
Deep Dive into React Stream/Serialize
mugi_uno
3
760
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.6k
The Cult of Friendly URLs
andyhume
74
5.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
323
20k
Faster Mobile Websites
deanohume
300
30k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
12
1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
228
16k
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
How STYLIGHT went responsive
nonsquared
92
4.8k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
0
50
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Ruby is Unlike a Banana
tanoku
96
10k
Build your cross-platform service in a week with App Engine
jlugia
226
17k
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
[email protected]
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/