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
32
Embracing the changing technology paradigms
avinashchugh
0
39
product thinking is problem solving.
avinashchugh
0
150
The anatomy of a platform.
avinashchugh
0
110
Evolutionary Enterprise Architectures
avinashchugh
0
62
Continuous Delivery in Motion
avinashchugh
0
130
seven tips to effective writing
avinashchugh
0
230
micro services, yotta benefits
avinashchugh
1
200
managing build artifacts with nexus
avinashchugh
0
94
Other Decks in Programming
See All in Programming
CSC307 Lecture 15
javiergs
PRO
0
260
SourceGeneratorのマーカー属性問題について
htkym
0
210
Feature Toggle は捨てやすく使おう
gennei
0
160
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
280
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
190
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
150
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.1k
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
130
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
820
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.1k
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
280
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
160
Featured
See All Featured
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
The Cult of Friendly URLs
andyhume
79
6.8k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
160
RailsConf 2023
tenderlove
30
1.4k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
830
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Google's AI Overviews - The New Search
badams
0
940
A Tale of Four Properties
chriscoyier
163
24k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
220
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
110
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/