emergent design - php jo'burg 2015
TRANSCRIPT
c a k e s , s h o w e r s a n d e l e c t r i c i a n s
EMERGENT DESIGN
Rouan Wilsenach @rouanw
thoughtworks.com
2
3
4
It is not enough for code to work.
- Robert Martin
5
6
WHY DESIGN ?
7
8
9
10
11 ANDY GREENBERG/WIRED
12Steve Jurvetson
13
Easy to learn Fast to changeFewer bugs
WHY EMERGENT ?
14
15https://www.flickr.com/photos/jshj/4619958228
16https://www.flickr.com/photos/chrisny2/4637837938
17
Build. Measure. Learn.
18
emerge
verb • become apparent
https://www.flickr.com/photos/schnappi/2321628609
19
not
become well-designed
https://www.flickr.com/photos/evaysucamara/5438832695
20
a change made in analysis for $1 would cost thousands
to fix in production
- The change curve
21
a change made in analysis for $1 would cost thousands
to fix in production
- The change curve
SIMPLICITYWhat is good design?
22
23
Why is this so hard? - Every developer, ever
24
a system made out of genuinely simple parts, is going to be able to
affect the greatest change with the least work
- Rich Hickey
25http://martinfowler.com/bliki/BeckDesignRules.html
AWAY FROM !
THE CODE
26
27
Talk about it
28
Draw something
29
Know your challenges
30
Where are we going?
31
IN FRONT OF !
THE CODE
32
33
refactoring
noun • a change made to the internal structure of software to
make it easier to understand and cheaper to modify without
changing its observable behaviour
http://martinfowler.com/bliki/DefinitionOfRefactoring.html
BEFOREPreparatory refactoring
34
35
Make the change easy (warning: this may be hard), then make the easy change
- Kent Beck
36
You must kill all your darlings
- William Faulkner
DURINGContinuous refactoring
37
38
Don’t forget the last step
39
Talk through it
AFTERTake a step back
40
41
When writing code we should always be
thinking of the reader - Martin Fowler
42
Always leave the campground cleaner than you found it.
- The boy scout rule, Robert Martin
43
Perfect is the enemy of good.
- Voltaire
SOME TECHNIQUES
44
45
Code smells
https://www.flickr.com/photos/ericparker/11245157393
46
Side effects
4747https://www.flickr.com/photos/campra/7833151482
Refactor to patterns
48
Clean code is a hygiene factor
https://www.flickr.com/photos/tambako/2515141429
49
There are only two hard things in Computer Science: cache invalidation
and naming things. - Phil Karlton
50
Small things are easier to understand
51
SOLID
S ingle responsibility principle
Open/closed principle…
RECAPAgain! Again!
52
53
Build. Measure. Learn.
Working code is not enough
change the change curve
54
Simplicity
55
In front of the code
Away from the code
SOME RESOURCES
Articles
• http://martinfowler.com/articles/designDead.html
• http://martinfowler.com/bliki/BeckDesignRules.html
• bit.ly/nf-ead-all (Neal Ford)
Videos
• http://www.infoq.com/presentations/Simple-Made-Easy (Rich Hickey)
• https://vimeo.com/16955608 (Neal Ford)
Books
• http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 (Uncle Bob)
• http://www.amazon.com/Extreme-Programming-Explained-Embrace-Edition/dp/0321278658 (Kent Beck)
News
• http://www.wired.com/2015/07/hackers-remotely-kill-jeep-highway/
• http://motherboard.vice.com/en_uk/read/how-is-critical-life-or-death-software-tested
56
a m e t a p h o r m a s h - u p
EMERGENT DESIGN
Rouan Wilsenach @rouanw
thoughtworks.com