Easy to use correctly, hard to use incorrectly
Christophe Addinquy, Zenika
www.agiletour.org05/11/10
Looking for wise expert rules ?
There are too many of them !
(Even if they are clever)
I end up with only one
Robert Martin
Craig Larman Martin Fowler
Ken BeckPragmatic Programmers
www.agiletour.org
« Make your interfaces easy to
use correctly and hard to use
incorrectly »
Scott Meyers
You can leave now !
Coding practices Design
User interfaces Requirements
Processes
?
Easy to use
correctly hard to
use incorrectly
Easy to use
correctly easy to
use incorrectly
Hard to use
correctly easy to
use incorrectly
Hard to use
correctly hard to
use incorrectly
Are you ready ?
•1 principle (to rule them all)
•5 themes
•20 exercises
•1 reflexion
It all starts with some
code...
Exercice 1
1 - What are the problems ?
2 - Spot this example
Naming can make it hard to use correctly
Naming should reveal the intention
What about parameters order ?
Exercice 2
Exercice 3
Size matters ... or at least abstraction level !
1 - Keep algorithm readable
2 - Keep concerns at the same abstraction level
Good habits to prevent mistakes
Safe tests à la Joel Spolsky
Can’t type ‘=’ instead of ‘==’
What about the
programming language ?
Type system
Case conventions «built in» in Ceylon
Let’s talk about design !
Getters & setters (1/4)
Exercice 4
Design by
Getters & setters (2/4)
Ooops !!!
Getters & setters (3/4) : RAII
Getters & setters (4/4)
• Getters / Setters are not abstractions
• Setters don’t enforce consistency
However...
Some frameworks require them !
Protocole usage (1/4)
Protocole usage (2/4)
Exercice 5
Protocole usage (3/4)
Exercice 6
Protocole usage (4/4)
Is your Decorator safe ? (1/2)
Caller Service
Decorator
1
Decorator
2
Exercice 7
Is your Decorator safe ? (2/2)
One step further : high
level design...
Convention over configuration
Exercice 8
What about user
interfaces ?
Example 1 : Vintage and funny...
•Chiptune
Exercice 9
Example 2 : is it what we call «serious game» ?
•SH Marketing
Exercice 10
Example 3 : Ticket selling & Zen
•Capitaine Train
Exercice 11
It also applies to
requirements user
stories...
Specify a user story
As a conference organizer I want to sell a
limited set of early bird tickets between T-3
months and T-2 months so that I secure
early incomes without jeopardizing the
potential revenue
Exercice 12
Acceptance criteria
Early bird ticket are available if the Early
bird period is running and if there is
enough early bird tickets left
Exercice 13
Acceptance tests
Let’s write some acceptance
tests together !
Exercice 14
Processes can also be
evaluated this way !
Processes to evaluate
Taylorism
Unified Process
Extreme Programming
Scrum
Lean
Evaluate «usability»,
not quality
Taylorism (scientific management)
• Workers needs is «safety» by
means of Maslow’s hierarchy
of needs
• The work at hand is highly
decomposable and is almost
mechanic
• The worker is «stupid» and try
to work as slow as possible
Teaching
Control
Feedback
Assumptions
Exercice 15
Unified process
Exercice 16
Extreme Programming
Exercice 17
Scrum
Exercice 18
Lean
Exercice 19
Next (and last) level
Can the advice be applied to itself
Easy to use
correctly, hard to
use incorrectly
Exercice 20
Relationship to agile
I’m not sure about it...
My guts feeling tell methere is one !
Let me know what you think !
Thank you !
christophe.addinquy@zenika.com
@addinquy
http://freethinker.addinq.uy
addinquy
addinquy
addinquy
addinquy
addinquy

Easy to use correctly, hard to use incorrectly