simple design
DESCRIPTION
A workshop on the Agile practice of Simple Design.TRANSCRIPT
The First 100 Hours:Simple Design
Jason Cheong-Kee-You @jpcky www.mightyjupiter.com
Alistair McKinnell
@amckinnell www.valuablecode.com
The First 100 Hours
The First 100 Hours
1. Learning
2. Test-Driven Development
3. Design
Pair Programming
44 A Rhythm for Success: TheTDD Cycle
R
ed
Gre
en
Refac
tor
Prepared exclusively for Alistair McKinnell Copyright ©2011 Pragmatic Programmers
Where DoYou Stand?
Simple Design
Simple Design
1. All tests must pass
2. No code is duplicated
3. Code is self-explanatory
4. No superfluous parts exist
Exercise
Exercise
Why are the four rules of simple design important?
1. All tests must pass
2. No code is duplicated
3. Code is self-explanatory
4. No superfluous parts exist
Simple Design
1. Passes its tests
2. No code is duplicated
3. Code is self-explanatory
4. No superfluous parts exist
Simple Design
1. Passes its tests
2. Minimizes duplication
3. Code is self-explanatory
4. No superfluous parts exist
Simple Design
1. Passes its tests
2. Minimizes duplication
3. Maximizes clarity
4. No superfluous parts exist
Simple Design
1. Passes its tests
2. Minimizes duplication
3. Maximizes clarity
4. Has fewer elements
Simple Design
1. Passes its tests (given TDD)
2. Minimizes duplication
3. Maximizes clarity
4. Has fewer elements
Simple Design
1. Passes its tests (given TDD)
2. Minimizes duplication
3. Maximizes clarity (fix names)
4. Has fewer elements
Simple Design
1. Passes its tests (given TDD)
2. Minimizes duplication
3. Maximizes clarity (fix names)
4. Has fewer elements
Simple Design
That leaves me with two key elementsof simple design: remove duplication and fix bad names.
When I remove duplication, I tend to seean appropriate structure emerge, and whenI fix bad names, I tend to see responsibilities slide into appropriate parts of the design.
J. B. Rainsberger
• Remove duplication
• Fix bad names
Simple Design
Exercise
Exercise
How to choose good names?
Build a checklist
Choosing Good Names
Choosing Good Names
Pronounceable Names
Avoid Encodings
Choosing Good Names
Intention-Revealing Name
Role-Suggesting Name
Choosing Good Names
Ubiquitous Language
Simple Design
1. All tests must pass
2. No code is duplicated
3. Code is self-explanatory
4. No superfluous parts exist
• Remove duplication
• Fix bad names
Simple Design
“The prime directive that was unanimously agree upon by allpresent was that in the nexttens years Agile leaders mustDemand Technical Excellence”
Jeff Sutherland
“Failure to do that meansyou are not an Agile leader”
Jeff Sutherland
Photo Credits
http://www.flickr.com/photos/54087404@N00/4638056301/
http://www.flickr.com/photos/49016492@N08/4534101229/
http://www.flickr.com/photos/27558040@N00/4151899795/
http://www.flickr.com/photos/21561428@N03/5520629205/
http://www.flickr.com/photos/flatcat/3555774083/