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
22
Embracing the changing technology paradigms
avinashchugh
0
16
product thinking is problem solving.
avinashchugh
0
120
The anatomy of a platform.
avinashchugh
0
84
Evolutionary Enterprise Architectures
avinashchugh
0
51
Continuous Delivery in Motion
avinashchugh
0
100
seven tips to effective writing
avinashchugh
0
160
micro services, yotta benefits
avinashchugh
1
160
managing build artifacts with nexus
avinashchugh
0
57
Other Decks in Programming
See All in Programming
導入から5年が経って見えた Datadog APM 運用の課題
bgpat
1
480
【KMC春合宿2024】実装視点で見るNeural Radiance Fields
runningoutrate
0
130
sbt-assemblyにハマってDB接続できず時間が溶けた話
wakye5815
1
660
メール認証とRuby
uvb_76
0
100
オレオレkaggle開発環境に Formatter/Linter入れてみた
stgkrt
0
340
Kotlinを用いたDSL的な設計手法と使用上の注意
kohii00
2
490
mandaRa: R言語ユーザのための新しい知識共有の場 / mandara_tokyor111
s_uryu
2
410
Catch Up with Swift 5.10
ojun9
1
450
ISUCONってなんだか難しそう……!!でも、初めてのISUCONにPHPで挑戦してきました!
kotomin_m
0
260
ADRを一年運用してみた/our_story_about_adr
hanhan1978
3
1.1k
ファイル先頭の use の意味、説明できますか? 〜PHP の namespace と autoloading の関係を正しく理解しよう〜 / namespace and autoloading in php
okashoi
2
380
まっちすいっち戦争 / match vs switch
takuyakatsusa
1
620
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
323
20k
Learning to Love Humans: Emotional Interface Design
aarron
266
39k
The Pragmatic Product Professional
lauravandoore
24
5.7k
Building Adaptive Systems
keathley
29
1.8k
Adopting Sorbet at Scale
ufuk
66
8.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
350
18k
Why You Should Never Use an ORM
jnunemaker
PRO
50
8.5k
How STYLIGHT went responsive
nonsquared
92
4.7k
Faster Mobile Websites
deanohume
296
30k
The Cult of Friendly URLs
andyhume
72
5.6k
GraphQLの誤解/rethinking-graphql
sonatard
48
9.1k
Teambox: Starting and Learning
jrom
126
8.3k
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/