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
26
Embracing the changing technology paradigms
avinashchugh
0
23
product thinking is problem solving.
avinashchugh
0
140
The anatomy of a platform.
avinashchugh
0
100
Evolutionary Enterprise Architectures
avinashchugh
0
55
Continuous Delivery in Motion
avinashchugh
0
120
seven tips to effective writing
avinashchugh
0
200
micro services, yotta benefits
avinashchugh
1
180
managing build artifacts with nexus
avinashchugh
0
77
Other Decks in Programming
See All in Programming
Amazon Bedrock Multi Agentsを試してきた
tm2
1
280
昭和の職場からアジャイルの世界へ
kumagoro95
1
360
TokyoR116_BeginnersSession1_環境構築
kotatyamtema
0
110
Open source software: how to live long and go far
gaelvaroquaux
0
630
ASP. NET CoreにおけるWebAPIの最新情報
tomokusaba
0
360
CNCF Project の作者が考えている OSS の運営
utam0k
6
710
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
410
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
320
Linux && Docker 研修/Linux && Docker training
forrep
24
4.5k
社内フレームワークとその依存性解決 / in-house framework and its dependency management
vvakame
1
550
技術を根付かせる / How to make technology take root
kubode
1
240
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
9
3.4k
Featured
See All Featured
A designer walks into a library…
pauljervisheath
205
24k
The Invisible Side of Design
smashingmag
299
50k
Gamification - CAS2011
davidbonilla
80
5.1k
Bash Introduction
62gerente
610
210k
Visualization
eitanlees
146
15k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
How STYLIGHT went responsive
nonsquared
98
5.4k
Automating Front-end Workflow
addyosmani
1367
200k
RailsConf 2023
tenderlove
29
1k
Producing Creativity
orderedlist
PRO
343
39k
Writing Fast Ruby
sferik
628
61k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
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/