Slide 1

Slide 1 text

@miciek Michał Płachta Developer on DETOX www.michalplachta.com

Slide 2

Slide 2 text

@miciek Meet John Craft

Slide 3

Slide 3 text

@miciek John Learns… All The Time

Slide 4

Slide 4 text

@miciek John Pair Programs

Slide 5

Slide 5 text

@miciek John uses TDD

Slide 6

Slide 6 text

@miciek John Monitors Tests Stability

Slide 7

Slide 7 text

@miciek John Uses Simple Design Passes Tests Reveals Intention No Duplication Fewest Elements

Slide 8

Slide 8 text

@miciek John Uses Monitoring

Slide 9

Slide 9 text

@miciek John Loves Code Reviews

Slide 10

Slide 10 text

@miciek John Cares About Cycle Time Idea Happy User

Slide 11

Slide 11 text

@miciek John Is Software Craftsman

Slide 12

Slide 12 text

@miciek John Aspires To Be An Artist 2MB RAM

Slide 13

Slide 13 text

@miciek vs Craftsman Artist

Slide 14

Slide 14 text

@miciek vs vs Craftsman Artist Human

Slide 15

Slide 15 text

@miciek The Friday’s Standup

Slide 16

Slide 16 text

@miciek The Story Of The Story Standup Review Started

Slide 17

Slide 17 text

@miciek What Would You Do? stay until names are fixed ask the team to finish merge change add “fix names” to backlog leave and continue when you’re back

Slide 18

Slide 18 text

@miciek vs vs Choice Craftsman Artist Human stay until names are fixed leave continue when you’re back ask the team to finish merge change add “fix names” to backlog

Slide 19

Slide 19 text

@miciek Decision Paralysis

Slide 20

Slide 20 text

@miciek John Uses Intuition

Slide 21

Slide 21 text

@miciek Doctor Satisfaction Chabris, Simons - “The Invisible Gorilla: How Our Intuitions Deceive Us”, p. 106 Doctor A Doctor B Doctor C Doctor D said nothing expressed uncertainty “You have nothing to lose” consulted a book prescribed antibiotics prescribed antibiotics prescribed antibiotics prescribed antibiotics Lowest perceived satisfaction! OMG! He consulted a book! We’re doomed!

Slide 22

Slide 22 text

@miciek Illusion Of Confidence http://redonline.cdnds.net/main/thumbs/18472/george-clooney-dr-doug-er-pictures-tv-shows-redonline.co.uk.jpg

Slide 23

Slide 23 text

@miciek Trivia Quiz Chabris, Simons - “The Invisible Gorilla: How Our Intuitions Deceive Us”, p. 100 Question #1 True or False? Question #1 True or False? Question #1 True or False? Question #1 True or False? Question #1 True or False? Your Confidence [50-100%]

Slide 24

Slide 24 text

@miciek Trivia Test Confidence Chabris, Simons - “The Invisible Gorilla: How Our Intuitions Deceive Us”, p. 100 Question #1 True or False? Question #1 True or False? Question #1 True or False? Question #1 True or False? Question #1 True or False? Your Confidence [50-100%] 60% average correctness 75% average confidence

Slide 25

Slide 25 text

@miciek Chabris, Simons - “The Invisible Gorilla: How Our Intuitions Deceive Us”, p. 100 Few Weeks Later... A Second Test Different Questions 90% confident people were the same I have a confident character! but still only 60% average correctness

Slide 26

Slide 26 text

@miciek “ Confidence appears to be a consistent quality [...] that has relatively little to do with one’s knowledge or mental ability. - Chabris, Simons Chabris, Simons - “The Invisible Gorilla: How Our Intuitions Deceive Us”, p. 101

Slide 27

Slide 27 text

@miciek Illusion Of Knowledge I use it every day! I know how it works! therefore

Slide 28

Slide 28 text

@miciek Quiz: How Does It Work? ▪ car speed meter? ▪ zipper? ▪ toilet? ▪ piano key? ▪ sewing machine? ▪ bike? rate your understanding 1-7 Chabris, Simons - “The Invisible Gorilla: How Our Intuitions Deceive Us”, p. 120

Slide 29

Slide 29 text

@miciek How Does A Bike Work? 4.5/7 average reported understanding https://www.dezeen.com/2016/06/19/velocipedia-project-hopeless-bicycle-drawings-life-digital-renders-gianluca-gimini/

Slide 30

Slide 30 text

@miciek Illusion of Confidence + Illusion of Knowledge = Opinion

Slide 31

Slide 31 text

@miciek Dealing With Illusions Why? Why? Why? Why? Why?

Slide 32

Slide 32 text

@miciek Why Does Bike Work? Why? Why? Why? Why? Why? Cyclist uses pedals to make the bike move and steering wheel to steer. Why do pedals make the bike move?

Slide 33

Slide 33 text

@miciek Why Do Pedals Make The Bike Move? Why? Why? Why? Why? Why? Pedals are connected with the chain drive which transmits the mechanical power and moves the wheels. Why do wheels move without falling?

Slide 34

Slide 34 text

@miciek Why Do Wheels Move Without Falling? Why? Why? Why? Why? Why? Thanks to the steering axis angle. Why is the steering axis angle so important?

Slide 35

Slide 35 text

@miciek Why Is Steering Axis Angle So Important? Why? Why? Why? Why? Why? Why don’t bikes fall when turning? http://www.fiztaszki.pl/node/56 Thanks to the trail.

Slide 36

Slide 36 text

@miciek Why Don’t Bikes Fall When Turning? Why? Why? Why? Why? Why? https://upload.wikimedia.org/wikipedia/commons/thumb/8/88/Tuftscriterium.jpg/728px-Tuftscriterium.jpg Thanks to the centrifugal force.

Slide 37

Slide 37 text

@miciek Developer’s Opinions tests are very important standups should be done every day open space are good for collaboration good names make the code readable Oh Yes!

Slide 38

Slide 38 text

@miciek John Was Under Influence of Illusions

Slide 39

Slide 39 text

@miciek Developer DETOX on “ Whenever I make a decision based on intuition, I state it openly and humbly. I am aware of my limitations. John - Humble Developer

Slide 40

Slide 40 text

@miciek Developer DETOX on Doesn’t say ■ “This is a good practice…” ■ “This is an antipattern…” ■ “Uncle Bob said that…” ■ “Everybody knows that…” ■ “This is prerequisite for having a clean code...” ■ “This is not advised...”

Slide 41

Slide 41 text

@miciek Any Alternatives? decisions based on data well-designed experiments evaluative research papers

Slide 42

Slide 42 text

@miciek Agenda Intuition & Illusions Example: Names Example: Backlog DETOX before DETOX after

Slide 43

Slide 43 text

@miciek What Would Developer On Detox Do? stay until names are fixed ask the team to finish merge change add “fix names” to backlog leave and continue when you’re back

Slide 44

Slide 44 text

@miciek Let’s Do Some Research!

Slide 45

Slide 45 text

@miciek “ There are only two hard things in Computer Science: cache invalidation and naming things. - Phil Karlton

Slide 46

Slide 46 text

@miciek The Good, The Bad and The Ugly... Name I am writing the code “Names look good” I am reviewing someone’s code “Names look bad/ugly” …because it’s a prerequisite to understand the rest! …or I don’t pay attention because I am focusing on concepts & design

Slide 47

Slide 47 text

@miciek Most Serious Problems LaToza, Venolia, DeLine - “Maintaining Mental Models: A Study of Developer Work Habits” This is a serious problem for me % agree “Understanding the rationale behind a piece of code” 66% “Understanding code that someone else wrote” 56% “Understanding the history of a piece of code” 51%

Slide 48

Slide 48 text

@miciek Most Serious Problems LaToza, Venolia, DeLine - “Maintaining Mental Models: A Study of Developer Work Habits” This is a serious problem for me % agree “Understanding the rationale behind a piece of code” 66% “Understanding code that someone else wrote” 56% “Understanding the history of a piece of code” 51% 17% “Understanding a piece of code written by me”

Slide 49

Slide 49 text

@miciek Names are ~70% Identifiers Keywords Delimiters Operators Literals 70% 30% (based on data from Eclipse 3.0M7, Tomcat 5.0.30, Sun JDK 1.4.2) / Deißenböck, Pizka - “Concise and Consistent Naming”

Slide 50

Slide 50 text

@miciek Dealing With Naming Problem Robert Martin - “Clean Code” “use intention-revealing names" “avoid disinformation" “make meaningful distinctions” “use pronounceable names” “use searchable names” “avoid encodings” “don't be cute” “don't pun” “pick one word per concept” “use solution domain names” “use problem domain names” “add meaningful context”

Slide 51

Slide 51 text

@miciek Cargo Cult Of Naming Conventions intention-revealing avoid meaningful use use avoid don't don't one word use use meaningful But what does meaningful even mean?

Slide 52

Slide 52 text

@miciek Difference Of Opinion “ 7-18% chance that two people apply the same name to an object* ...a name not only needs to be meaningful but reflect the correct meaning. Second, the “correct” meaning and name of a concept is naturally highly debatable. - Deißenböck, Pizka *G. Butler, P. Grogono, R. Shinghal, and I. Tjandra. Retrieving information from data flow diagrams. In Working Conference on Reverse Engineering, pages 84–93, November 1995.

Slide 53

Slide 53 text

@miciek n1 Identifier Names (N) Concepts (C) n1 c1 c2 n2 Identifier Naming Formally ... all identifiers found in the source code ... all concepts related to the project & team R concept c1 is represented by n2 in the code Deißenböck, Pizka - “Concise and Consistent Naming”

Slide 54

Slide 54 text

@miciek n1 Identifier Names (N) Concepts (C) book to book a book number accountNumber an account number a phone number Homonyms & Synonyms

Slide 55

Slide 55 text

@miciek n1 Identifier Names (N) Concepts (C) book reserve to book reserve a book number phoneNumber accountNumber an account number a phone number Renaming and Code Decay

Slide 56

Slide 56 text

@miciek Keeping Up With All The Names Deißenböck, Pizka - “Concise and Consistent Naming” Project # identifiers # words Eclipse 3.0M7 94,829 7,233 Sun’s JDK 1.4.2 42,869 6,426 Tomcat 5.0.30 11,656 2,587 About half as much as Oxford Advanced Learner’s Dictionary examples: frag, fragement, fragment, fragmentation, fragmented, fragmentname, fragments, frags

Slide 57

Slide 57 text

@miciek n1 Identifier Names (N) Concepts (C) reserve reserve book phoneNumber accountNumber account number phone number Control The Concept Space! book Deißenböck, Pizka - “Concise and Consistent Naming”

Slide 58

Slide 58 text

@miciek Pure Concepts As Names distance_between_abscissae = first_abscissa - second_abscissa distance_between_ordinates = first_ordinate - second_ordinate cartesian_distance = square_root( distance_between_abscissae * distance_between_abscissae + distance_between_ordinates * distance_between_ordinates) Lawrie, Morrell - “Identifier length and limited programmer memory”

Slide 59

Slide 59 text

@miciek Concept Can Be An Abbreviation distance_between_abscissae = first_abscissa - second_abscissa distance_between_ordinates = first_ordinate - second_ordinate cartesian_distance = square_root( distance_between_abscissae * distance_between_abscissae + distance_between_ordinates * distance_between_ordinates) dx = x1 - x2 dy = y1 - y2 dist = sqrt(dx * dx + dy * dy) Concepts (C) dx dy dist x1 x2 y1 y2 Lawrie, Morrell - “Identifier length and limited programmer memory”

Slide 60

Slide 60 text

@miciek Being A Good Naming Craftsman one name per concept no homonyms no synonyms well defined abbreviations

Slide 61

Slide 61 text

@miciek Being A Good Naming Craftsman one name per concept no homonyms no synonyms well defined abbreviations currently impossible!

Slide 62

Slide 62 text

@miciek Being A Good Decent Naming Craftsman don’t pick on someone else’s names find & analyse existing names

Slide 63

Slide 63 text

@miciek Agenda Intuition & Illusions Example: Names Example: Backlog DETOX before DETOX after

Slide 64

Slide 64 text

@miciek Backlog = To-Do List “ ...list of features or technical tasks which the team maintains and which, at a given moment, are known to be necessary and sufficient to complete a project or a release. - Agile Alliance https://www.atlassian.com/agile/backlogs

Slide 65

Slide 65 text

@miciek Dev’s To Do Dev’s To Do Stakeholders’ To-Do Dev’s To Do User’s To Do PO’s To Do Team’s To Do Backlog

Slide 66

Slide 66 text

@miciek Brain Dump Call Mom Jim’s flowers Take out trash Do bank papers Buy lightbulbs Fix bug in X Fix flaky test Add Feature Z Refactor Y’s API Better names in X

Slide 67

Slide 67 text

@miciek iDoneThis case http://blog.idonethis.com/how-to-master-the-art-of-to-do-lists/ Done List 160,000 users done to-do reported dones

Slide 68

Slide 68 text

@miciek 85% dones were not to-do items Human vs Human’s Plan 41% to-do items never completed http://blog.idonethis.com/how-to-master-the-art-of-to-do-lists/ 78% to-do items done within a day We suck at planning and there is no hope...

Slide 69

Slide 69 text

@miciek Ocado Backlogs Project Total Items Never Done Never Done % Pick Station 1337 637 47% Phoenix Core 1192 553 46% Decant 1013 437 43% Phoenix Outbound 1725 618 35% OSP RMS 379 105 27% Hawk 1763 395 22% Data gathered 6.02.2017

Slide 70

Slide 70 text

@miciek Why Do We Do That? 20-50% backlog items never completed someone created them someone discussed them someone analysed them someone groomed them someone prioritised them someone deleted them

Slide 71

Slide 71 text

@miciek Zeigarnik Effect https://pl.pinterest.com/pin/59250551327511553/

Slide 72

Slide 72 text

@miciek Zeigarnik Intrusions Experiment Masicampo, Baumeister - “Consider It Done! Plan Making Can Eliminate the Cognitive Effects of Unfulfilled Goals” Group #1 “Unfulfilled” Group #2 “Plan” Group #3 “Control” 2 important future tasks 2 important past tasks - make when, why, how plans - read 3,200 words answer questions about the text

Slide 73

Slide 73 text

@miciek Zeigarnik Intrusions Masicampo, Baumeister - “Consider It Done! Plan Making Can Eliminate the Cognitive Effects of Unfulfilled Goals” Group #1 “Unfulfilled” Group #2 “Plan” Group #3 “Control” ability to focus (1-7) 4.61 5.56 5.29 mind wanderings 65% 33% 50% reading comprehension 6.13 6.94 6.93

Slide 74

Slide 74 text

@miciek Masicampo, Baumeister - “Consider It Done! Plan Making Can Eliminate the Cognitive Effects of Unfulfilled Goals” “Participants who reflected on two important but unfinished tasks were distracted…” “...forming a plan can eliminate cognitive activity from unfulfilled goal…” PLAN = how, when, and why to complete the goal

Slide 75

Slide 75 text

@miciek Does It Work For Multiple Goals? NO! “...specific planning is less effective for multiple goals versus a single goal..”

Slide 76

Slide 76 text

@miciek Being A Backlog-aware Craftsman don’t add things to backlog add only if you have a detailed plan add only if you’ll do it very soon

Slide 77

Slide 77 text

@miciek John Had A Problem stay until names are fixed ask the team to finish merge change add “fix names” to backlog leave and continue when you’re back

Slide 78

Slide 78 text

@miciek John Was Under Influence of Illusions

Slide 79

Slide 79 text

@miciek Developer DETOX on Doesn’t say ■ “This is a good practice…” ■ “This is an antipattern…” ■ “Uncle Bob said that…” ■ “Everybody knows that…” ■ “This is prerequisite for having a clean code...” ■ “This is not advised...”

Slide 80

Slide 80 text

@miciek Developer DETOX on Says ■ “Let me check the research about…” ■ “Let me do an experiment…” ■ “Here’s data that supports my claim…” And... ■ “I am sorry, I used my intuition here…”

Slide 81

Slide 81 text

@miciek John Did Some Research! don’t pick on someone else’s names find & analyse existing names

Slide 82

Slide 82 text

@miciek John Did Some Research! don’t add things to backlog

Slide 83

Slide 83 text

@miciek John Did Some Research! ■ read some papers ■ did some experiments ■ drew conclusions

Slide 84

Slide 84 text

@miciek ▪ “Folklore and science of naming practices” http://michalplachta.com/2017/01/22/folklore-and-science-of-naming-practices/ ▪ “Quantifying Identifier Quality: An Analysis of Trends” Lawrie, Feild, Binkley http://www.cs.loyola.edu/~lawrie/papers/lawrieJese07.pdf ▪ “Concise and Consistent Naming” Deißenböck & Pizka http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.70.618&rank=1 ▪ “Clean Code: A Handbook of Agile Software Craftsmanship” Robert C. Martin ▪ “Maintaining Mental Models: A Study of Developer Work Habits” LaToza, Venolia, DeLine http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.111.2317&rank=1 ▪ “Identifier length and limited programmer memory” Binkley, Lawrie, Maex, Morrell ▪ “The effects of comments and identifier names on program comprehensibility: An experimental investigation” Takang, Grubb, Macredie ▪ “Effective Identifier Names for Comprehension and Memory” Lawrie, Morrell, Feild, Binkley References - Naming Research

Slide 85

Slide 85 text

@miciek ▪ “What a To-Do: Studies of Task Management Towards the Design of a Personal Task List Manager” Bellotti, Dalal, Good, Flynn, Bobrow. Ducheneaut ▪ “How to Master the Art of To-Do Lists by Understanding Why They Fail” http://blog.idonethis.com/how-to-master-the-art-of-to-do-lists/ ▪ “Consider It Done! Plan Making Can Eliminate the Cognitive Effects of Unfulfilled Goals” Masicampo, Baumeister ▪ “Too Much of a Good Thing: The Benefits of Implementation Intentions Depend on the Number of Goals” Dalton, Spiller ▪ “To-Do Lists Don’t Work” https://hbr.org/2012/01/to-do-lists-dont-work ▪ “The Scrum Backlog is where Features go to die” https://medium.com/product-love/the-scrum-backlog-is-where-features-go-to-die- b1336ff707aa References - Backlog Research

Slide 86

Slide 86 text

@miciek ▪ “Velocipedia” https://www.dezeen.com/2016/06/19/velocipedia-project-hopeless-bicycle-dra wings-life-digital-renders-gianluca-gimini/ ▪ “The Invisible Gorilla: How Our Intuitions Deceive Us” Chabris, Simons References - Intuition Research

Slide 87

Slide 87 text

@miciek Thanks! Developer DETOX on ANY QUESTIONS? Michał Płachta www.michalplachta.com

Slide 88

Slide 88 text

@miciek ~FIN~