Choice is the Enemy of Good � William Bartlett william.bartlett@zenika.com � @bartlettstarman � punkstarman � punkstarman Zenika William Bartlett (@bartlettstarman) Choice is the Enemy of Good 1 / 46
A presentation at Voxxed Days Thessaloniki 2022 in June 2022 in Thessaloniki, Greece by William Bartlett
Choice is the Enemy of Good � William Bartlett william.bartlett@zenika.com � @bartlettstarman � punkstarman � punkstarman Zenika William Bartlett (@bartlettstarman) Choice is the Enemy of Good 1 / 46
Γειά σας! Με λένε Γουίλιαμ. Είμαι Βρετανός και Αμερικανός. Μένω στη Νάντη στη Γαλλία. Είμαι σύμβουλος στo Ζένικα. William Bartlett (@bartlettstarman) Choice is the Enemy of Good 2 / 46
William Bartlett (@bartlettstarman) Choice is the Enemy of Good 3 / 46
William Bartlett (@bartlettstarman) Choice is the Enemy of Good 4 / 46
William Bartlett (@bartlettstarman) Choice is the Enemy of Good 5 / 46
William Bartlett (@bartlettstarman) Choice is the Enemy of Good 6 / 46
William Bartlett (@bartlettstarman) Choice is the Enemy of Good 7 / 46
William Bartlett (@bartlettstarman) Choice is the Enemy of Good 8 / 46
We have yet to write a single line of business logic William Bartlett (@bartlettstarman) Choice is the Enemy of Good 9 / 46
We have yet to write a single line of business logic Other programming languages have similar problems. William Bartlett (@bartlettstarman) Choice is the Enemy of Good 9 / 46
How can we get stuff done and feel good about it? William Bartlett (@bartlettstarman) Choice is the Enemy of Good 10 / 46
Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely. — Agile Manifesto William Bartlett (@bartlettstarman) Choice is the Enemy of Good 11 / 46
Sustainable development is development that meets the needs of the present without compromising the ability of future generations to meet their own needs. — Brundtland Report William Bartlett (@bartlettstarman) Choice is the Enemy of Good 12 / 46
How do we choose? Section 1 How do we choose? William Bartlett (@bartlettstarman) Choice is the Enemy of Good 13 / 46
How do we choose? Reason William Bartlett (@bartlettstarman) Choice is the Enemy of Good 14 / 46
How do we choose? William Bartlett (@bartlettstarman) Choice is the Enemy of Good 15 / 46
How do we choose? Emotion William Bartlett (@bartlettstarman) Choice is the Enemy of Good 16 / 46
How do we choose? Emotion 4. Rationalizing an emotional decision. Go was fun. It felt right. We thought: “if we’re willing to adopt Go on a gut feeling, maybe other systems geeks will be too? And wouldn’t it be cool if we could get them to feel that way about Docker, too?” — � Solomon Hykes William Bartlett (@bartlettstarman) Choice is the Enemy of Good 17 / 46
How do we choose? Emotion Reason is, and ought only to be the slave of the passions, and can never pretend to any other office than to serve and obey them. — David Hume. A Treatise of Human Nature William Bartlett (@bartlettstarman) Choice is the Enemy of Good 18 / 46
How do we choose? Observation CC-BY-SA-3.0 Olga Tarkovskiy (Wikimedia Commons) William Bartlett (@bartlettstarman) Choice is the Enemy of Good 19 / 46
How do we choose? Lifecycle Early adopters Early majority Late majority Laggards because of how because of why because of others because of obligation chasm Diffusion of Innovation. Everett Rogers. 1962 — Crossing the Chasm. Geoffrey A. Moore. 1991 William Bartlett (@bartlettstarman) Choice is the Enemy of Good 20 / 46
How do we choose? Luck William Bartlett (@bartlettstarman) Choice is the Enemy of Good 21 / 46
How do we choose? Luck [Luck] plays a very large role in every story of success. — Daniel Kahneman. Thinking, Fast and Slow William Bartlett (@bartlettstarman) Choice is the Enemy of Good 22 / 46
Contextual Decision-Making Section 2 Contextual Decision-Making William Bartlett (@bartlettstarman) Choice is the Enemy of Good 23 / 46
Contextual Decision-Making Cynefin Cynefin (Κυνέβιν) Complex Complicated AC Chaotic A = Aporia Sense-making framework created by Dave Snowden Clear C = Confused William Bartlett (@bartlettstarman) Choice is the Enemy of Good 24 / 46
Contextual Decision-Making Cynefin Clear Predictable cause and effect known to all I Apply best practices I Take time for tech watch Examples: I indentation, code style I sorting algorithm William Bartlett (@bartlettstarman) Choice is the Enemy of Good 25 / 46
Contextual Decision-Making I have yet to see any problem, however complicated, which, when you looked at it in the right way, did not become still more complicated. — Anderson’s Law William Bartlett (@bartlettstarman) Choice is the Enemy of Good 26 / 46
Contextual Decision-Making Cynefin Complicated Predictable cause and effect known to experts I Ask experts, rely on experience I Use analysis expertise is lacking I Share expertise, when needed Examples: I testing strategies I security William Bartlett (@bartlettstarman) Choice is the Enemy of Good 27 / 46
Contextual Decision-Making Cynefin Complex Any action has unintended consequences Examples: I large-scale distributed systems I organizations, teams William Bartlett (@bartlettstarman) Choice is the Enemy of Good 28 / 46
Contextual Decision-Making Cynefin Complex Any action has unintended consequences I Diversity William Bartlett (@bartlettstarman) Choice is the Enemy of Good 28 / 46
Contextual Decision-Making Cynefin Complex Any action has unintended consequences I Diversity I Do the next right thing (coherence) William Bartlett (@bartlettstarman) Choice is the Enemy of Good 28 / 46
Contextual Decision-Making Cynefin Complex Any action has unintended consequences I Diversity I Do the next right thing (coherence) I Keep options open William Bartlett (@bartlettstarman) Choice is the Enemy of Good 28 / 46
Contextual Decision-Making Cynefin Complex Any action has unintended consequences I I I I Diversity Do the next right thing (coherence) Keep options open Let the market decide William Bartlett (@bartlettstarman) Choice is the Enemy of Good 28 / 46
Contextual Decision-Making Cynefin Complex Any action has unintended consequences I I I I I Diversity Do the next right thing (coherence) Keep options open Let the market decide Document decisions (Architecture Decision Record) William Bartlett (@bartlettstarman) Choice is the Enemy of Good 28 / 46
Contextual Decision-Making Parallel safe to fail probes When trying something new, do it on a scale where failure is survivable. — Peter Palchinsky’s 2nd principle William Bartlett (@bartlettstarman) Choice is the Enemy of Good 29 / 46
Contextual Decision-Making Parallel safe to fail probes When trying something new, do it on a scale where failure is survivable. — Peter Palchinsky’s 2nd principle Nothing is more dangerous than an idea when it is the only one you have. — Emile Chartier William Bartlett (@bartlettstarman) Choice is the Enemy of Good 29 / 46
Contextual Decision-Making Retrospective Prime Directive Regardless of what we discover, we understand and truly believe that everyone did the best job they could, given what they knew at the time, their skills and abilities, the resources available, and the situation at hand. — Norm Kerth. Project Retrospectives: A Handbook for Team Review William Bartlett (@bartlettstarman) Choice is the Enemy of Good 30 / 46
Plan-Do-Study-Act Section 3 Plan-Do-Study-Act William Bartlett (@bartlettstarman) Choice is the Enemy of Good 31 / 46
Plan-Do-Study-Act Plan-Do-Study-Act Plan Do Act Study William Bartlett (@bartlettstarman) Choice is the Enemy of Good 32 / 46
Plan-Do-Study-Act Plan-Do-Study-Act I renders certain arguments unnecessary William Bartlett (@bartlettstarman) Choice is the Enemy of Good 33 / 46
Plan-Do-Study-Act Plan-Do-Study-Act I renders certain arguments unnecessary I pushes us to debate facts instead of fiction William Bartlett (@bartlettstarman) Choice is the Enemy of Good 33 / 46
Plan-Do-Study-Act Plan-Do-Study-Act I renders certain arguments unnecessary I pushes us to debate facts instead of fiction I allows codebases to mature at the same rate as the team William Bartlett (@bartlettstarman) Choice is the Enemy of Good 33 / 46
Plan-Do-Study-Act Malleable Code Malleability enhances PDSA William Bartlett (@bartlettstarman) Choice is the Enemy of Good 34 / 46
Plan-Do-Study-Act Malleable Code Malleability enhances PDSA I Disposability William Bartlett (@bartlettstarman) Choice is the Enemy of Good 34 / 46
Plan-Do-Study-Act Malleable Code Malleability enhances PDSA I Disposability I Decoupling William Bartlett (@bartlettstarman) Choice is the Enemy of Good 34 / 46
Plan-Do-Study-Act Malleable Code Malleability enhances PDSA I Disposability I Decoupling I Test-Driven Development William Bartlett (@bartlettstarman) Choice is the Enemy of Good 34 / 46
Plan-Do-Study-Act What TDD is not TDD is not I writing the tests before the code I unit testing every single function I a substitute for other forms of testing William Bartlett (@bartlettstarman) Choice is the Enemy of Good 35 / 46
Plan-Do-Study-Act What TDD is Plan refactor code to match Do Act Study William Bartlett (@bartlettstarman) write test that fails write code why code works Choice is the Enemy of Good 36 / 46
Plan-Do-Study-Act What TDD accomplishes Plan prove flexibility Do Act Study William Bartlett (@bartlettstarman) choose an outcome experiment learn Choice is the Enemy of Good 37 / 46
Plan-Do-Study-Act Evolution of a Java Programmer public class Factorial { public long factorial(long n) { … } } William Bartlett (@bartlettstarman) Choice is the Enemy of Good 38 / 46
Plan-Do-Study-Act Evolution of a Java Programmer Java 1.1 - simple and effective public long factorial(long n) { long result = 1; for (long i=1; i<=n; i++) { result = result * i; } return result; } William Bartlett (@bartlettstarman) Choice is the Enemy of Good 39 / 46
Plan-Do-Study-Act Evolution of a Java Programmer Java 1.2 - Collections public long factorial(long n) { List factors = new ArrayList(); for (long i=1; i<=n; i++) { factors.add(i); } long result = 1; Iterator it = factors.iterator(); while (it.hasNext()) { long factor = ((Long)it.next()).longValue(); result *= factor; } return result; } William Bartlett (@bartlettstarman) Choice is the Enemy of Good 40 / 46
Plan-Do-Study-Act Evolution of a Java Programmer Java 5 - Generics and foreach loops public long factorial(long n) { List<Long> factors = new ArrayList<Long>(); for (long i=1; i<=n; i++) { factors.add(i); } long result = 1; for (long factor: factors) { result *= factor; } return result; } William Bartlett (@bartlettstarman) Choice is the Enemy of Good 41 / 46
Plan-Do-Study-Act Evolution of a Java Programmer Java 7 - Parallelism public long factorial(long n) { ForkJoinPool pool = new ForkJoinPool(); return pool.invoke(new FactorialTask(1, n)); } William Bartlett (@bartlettstarman) Choice is the Enemy of Good 42 / 46
Plan-Do-Study-Act Evolution of a Java Programmer Java 7 - Parallelism class FactorialTask extends RecursiveTask<Long> { @Override protected Long compute() { if (lo > hi) return 1L; if (lo == hi) return lo; } long mid = (lo + hi) / 2L; FactorialTask f1 = new FactorialTask(lo, mid); f1.fork(); FactorialTask f2 = new FactorialTask(mid + 1L, hi); return f2.compute() * f1.join(); } William Bartlett (@bartlettstarman) Choice is the Enemy of Good 43 / 46
Plan-Do-Study-Act Evolution of a Java Programmer Java 8 - Functional streams public long factorial(long n) { return LongStream .rangeClosed(1, n) .reduce(1, (a, b) -> a * b); } William Bartlett (@bartlettstarman) Choice is the Enemy of Good 44 / 46
Conclusion Section 4 Conclusion William Bartlett (@bartlettstarman) Choice is the Enemy of Good 45 / 46
Conclusion Choice Is the Enemy of Good Don’t complicate things needlessly Develop and use expert knowledge and experience Plan-Do-Study-Act (TDD) Do the next right thing Keep options open William Bartlett (@bartlettstarman) Choice is the Enemy of Good 46 / 46