Slide 1

Slide 1 text

Where Bad Code Comes From? June 2012

Slide 2

Slide 2 text

I’m Marcin Floryan http://marcin.floryan.pl

Slide 3

Slide 3 text

Energized Work @mfloryan Value, Flow, Quality You can find me at:

Slide 4

Slide 4 text

The ACE Conference: This presentation: #aceconf #mfbadcode

Slide 5

Slide 5 text

Acceptance criteria You can give examples of different sources of bad code You have identified one new reason for bad code you didn’t pay attention to before You will consider a way to tackle it ☐ ☐ ☐

Slide 6

Slide 6 text

Any developers in the room?

Slide 7

Slide 7 text

Seen any bad code?

Slide 8

Slide 8 text

? Experienced

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

? how bad can it get

Slide 11

Slide 11 text

Mariner 1 $18.5 million

Slide 12

Slide 12 text

Hartford Coliseum $80 million

Slide 13

Slide 13 text

Ariane 5 $500 million

Slide 14

Slide 14 text

“One  bug,  one  crash.  Of  all   the  careless  lines  of  code   this  one  may  stand  as  the   most  devastatingly efficient.   James Gleick

Slide 15

Slide 15 text

North America black-out 55 million people

Slide 16

Slide 16 text

“To  err  is  human,  but  to   really  foul  things  up  you   need  a  computer.   Paul Ehrlich

Slide 17

Slide 17 text

Does your code resemble

Slide 18

Slide 18 text

or this…?

Slide 19

Slide 19 text

Building

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Building

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

what how code

Slide 24

Slide 24 text

“When  people  are   factored  in,     nothing  is  simple.   Ken Schwaber

Slide 25

Slide 25 text

what how who code

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

“A post-modern firm is rich in information and relies heavily on the daily choices of its knowledgeable employees. Haridimos Tsoukas

Slide 28

Slide 28 text

Let’s go back in time

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

What’s that rustling in the bushes?

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

FIGHT

Slide 35

Slide 35 text

You’re fed

Slide 36

Slide 36 text

What’s that rustling in the bushes?

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

F IGHT L

Slide 39

Slide 39 text

You’re safe

Slide 40

Slide 40 text

back to reality

Slide 41

Slide 41 text

How about that RAG report?

Slide 42

Slide 42 text

Running late?

Slide 43

Slide 43 text

Add more people

Slide 44

Slide 44 text

Even more late * *  Consult  the  Brooks  Law  for  details  

Slide 45

Slide 45 text

How about that RAG report?

Slide 46

Slide 46 text

Already over budget?

Slide 47

Slide 47 text

Let’s squeeze the testing

Slide 48

Slide 48 text

What do you mean quality?

Slide 49

Slide 49 text

But it worked so well

Slide 50

Slide 50 text

Do you ever fly?

Slide 51

Slide 51 text

? a novice pilot

Slide 52

Slide 52 text

or perhaps even

Slide 53

Slide 53 text

Welcome aboard KLM Flight 4805

Slide 54

Slide 54 text

A bomb in a flower shop

Slide 55

Slide 55 text

Landing at Tenerife

Slide 56

Slide 56 text

law mandated rest period looming

Slide 57

Slide 57 text

decision to re-fuel

Slide 58

Slide 58 text

and a T H I C K fog

Slide 59

Slide 59 text

KLM 747 crashes

Slide 60

Slide 60 text

Communication misunderstandings deadliest accident in aviation history

Slide 61

Slide 61 text

Junior pilots any better? remember Air France flight 447

Slide 62

Slide 62 text

so how about

Slide 63

Slide 63 text

? Ever worked

Slide 64

Slide 64 text

? Ever worked

Slide 65

Slide 65 text

? Ever worked

Slide 66

Slide 66 text

meet Bob*

Slide 67

Slide 67 text

“Good, safe social interaction is as necessary to successful development as good technical skills Kent Beck

Slide 68

Slide 68 text

Difficult Conversations

Slide 69

Slide 69 text

Recognise

Slide 70

Slide 70 text

How do we tell… our tester you let all these nasty bugs through

Slide 71

Slide 71 text

How do we tell… a new developer you don’t know the framework well enough

Slide 72

Slide 72 text

How do we tell… project manager we are not resources

Slide 73

Slide 73 text

How do we tell… stakeholders your   expectaAons   are   unrealisAc

Slide 74

Slide 74 text

How do we tell… operations we  need  it   live  NOW

Slide 75

Slide 75 text

How do we tell… our client I am unable to add value as a coach

Slide 76

Slide 76 text

we DON’T.

Slide 77

Slide 77 text

instead

Slide 78

Slide 78 text

Time for

Slide 79

Slide 79 text

Ehm… no.

Slide 80

Slide 80 text

I want you to learn

Slide 81

Slide 81 text

“One must learn by doing the thing; for though you think you know it, you have no certainty, until you try. Sophocles

Slide 82

Slide 82 text

so instead

Slide 83

Slide 83 text

some

Slide 84

Slide 84 text

Your job 1.  Find some bad code 2.  Trace it back to a difficult conversation 3.  How could you have done it differently?

Slide 85

Slide 85 text

My example 1.  Data transfer via FTP upload of text files is really clunky 2.  That’s the way things are done around here. We never challenged this. 3.  Ask to understand rationale behind the decision, present viable alternatives

Slide 86

Slide 86 text

Follow-Up •  Catch me, stop me, talk to me •  Contact me on twitter @mfloryan •  Submit and discuss your ideas bit.ly/ace-homework

Slide 87

Slide 87 text

The Remember Slide • We’re not optimised for writing code • Our mental software is mostly legacy code • We don’t talk to each other • We hide our emotions

Slide 88

Slide 88 text

Bibliography

Slide 89

Slide 89 text

So Thank You bit.ly/ace-bad-code

Slide 90

Slide 90 text

Resources •  Hartford Civic Center Arena Roof Collapse http://www.eng.uab.edu/cee/faculty/ndelatte/case_studies_project/Hartford%20Civic%20Center/hartford.htm •  Mariner 1 http://en.wikipedia.org/wiki/Mariner_1 •  Ariane 5 http://www.around.com/ariane.html •  KLM flight 4805 http://en.wikipedia.org/wiki/Tenerife_airport_disaster •  Air France flight 447 http://en.wikipedia.org/wiki/Air_France_Flight_447 •  2003 North America black-out http://en.wikipedia.org/wiki/2003_North_America_blackout •  The Kludge Tweet https://twitter.com/jmeydam/status/143405066571886592

Slide 91

Slide 91 text

Picture Credits •  The Bismuth Cristals based on “Wismut Kristall und 1cm3 Wuerfel” photo by Alchemist-hp from Wikimedia Commons under FreeArt license •  "FIGURE 02.2 The Manifesto for Agile Software Development” from flickr by Jurgen Appelo from flickr licensed under Creative-Commons-by-2.0 license •  "FIGURE 02.3 The Manifesto for Software Craftsmanship” from flickr by Jurgen Appelo from flickr licensed under Creative-Commons-by-2.0 license •  ”bushes" from flickr by Rupert Ganzer under Creative-Commons-by-nd-2.0 license •  ”Cottontail Rabbit" from flickr by Ken Slade under Creative-Commons-by-nc-2.0 license •  “Lion” from flickr by Angela Huxham under Creative-Commons-by-nc-sa-2.0 license •  ”the first standup" photo from flickr by Karthik Chandrasekariah under Creative-Commons-by-nc-2.0 license •  "Traffic light stacking" photo from flickr by fabi42 under Creative-Commons-by-nc-sa-2.0 license •  “Tenerife747s” picture from Wikimedia Commons by Anynobody under Creative Commons by-sa-3.0 license •  The Difficult Conversations picture is by Olaf Lewitz from XP Days Benelux 2012 available on G+ •  The Coaching Dojo picture is from Olaf Lewitz (By Ole) at XP Days Benelux 2012 available on G+ The remaining pictures are used under the fair use policy or available in public domain.

Slide 92

Slide 92 text

License This presentation is provided under the Creative Commons Attribution - Share Alike 3.0 Unported License to Share — to copy, distribute and transmit the work to Remix — to adapt the work You are free Under the following conditions Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.