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
1.2k
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
clean code: four rules of simple design
the slide deck used for an internal design/programming workshop for developers.
Avinash Chugh
May 31, 2014
More Decks by Avinash Chugh
See All by Avinash Chugh
Platform Thinking - Bringing Agility to Business
avinashchugh
0
46
Embracing the changing technology paradigms
avinashchugh
0
51
product thinking is problem solving.
avinashchugh
0
160
The anatomy of a platform.
avinashchugh
0
120
Evolutionary Enterprise Architectures
avinashchugh
0
68
Continuous Delivery in Motion
avinashchugh
0
150
seven tips to effective writing
avinashchugh
0
250
micro services, yotta benefits
avinashchugh
1
220
managing build artifacts with nexus
avinashchugh
0
110
Other Decks in Programming
See All in Programming
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
590
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
710
テーブルをDELETEした
yuzneri
0
140
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
210
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
4.2k
the container ship “Apple Silicon”@WWDC26 Recap -Japan-\(region).swift
shingangan
0
120
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.9k
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
520
メールのエイリアス機能を履き違えない
isshinfunada
0
230
FDEが実現するAI駆動経営の現在地
gonta
2
280
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
180
What's New in Android 2026
veronikapj
0
260
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.6k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
330
The Curse of the Amulet
leimatthew05
2
14k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
750
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
200
Designing Experiences People Love
moore
143
24k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
530
Building Flexible Design Systems
yeseniaperezcruz
330
40k
How to make the Groovebox
asonas
2
2.3k
Thoughts on Productivity
jonyablonski
76
5.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/