92
Where Bad Code Comes From? June 2012

Where Bad Code Comes From

Embed Size (px)

DESCRIPTION

This is the slide deck presented at the ACE! 2012 conference in Kraków in June 2012. If you joined the talk use the slides for reference. If you haven't seen the talk and have a chance to see it again, allow yourself to be surprised by skipping the slides for now ;)

Citation preview

Page 1: Where Bad Code Comes From

Where Bad Code Comes From? June 2012

Page 2: Where Bad Code Comes From

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

Page 3: Where Bad Code Comes From

Energized Work @mfloryan Value, Flow, Quality

You can find me at:

Page 4: Where Bad Code Comes From

The ACE Conference:

This presentation:

#aceconf

#mfbadcode

Page 5: Where Bad Code Comes From

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

Page 6: Where Bad Code Comes From

Any developers in the room?

Page 7: Where Bad Code Comes From

Seen any bad code?

Page 8: Where Bad Code Comes From

? Experienced ���any bad code

Page 9: Where Bad Code Comes From
Page 10: Where Bad Code Comes From

? how bad can it get

Page 11: Where Bad Code Comes From

Mariner 1

$18.5 million

Page 12: Where Bad Code Comes From

Hartford Coliseum

$80 million

Page 13: Where Bad Code Comes From

Ariane 5

$500 million

Page 14: Where Bad Code Comes From

““One  bug,  one  crash.  Of  all  the  careless  lines  of  code  

this  one  may  stand  as  the  most  devastatingly efficient.  

James Gleick

Page 15: Where Bad Code Comes From

North America black-out

55 million people

Page 16: Where Bad Code Comes From

““To  err  is  human,  but  to  

really  foul  things  up  you  need  a  computer.  

Paul Ehrlich

Page 17: Where Bad Code Comes From

Does your code resemble ���this

Page 18: Where Bad Code Comes From

or this…?

Page 19: Where Bad Code Comes From

Building ���the wrong thing

Page 20: Where Bad Code Comes From
Page 21: Where Bad Code Comes From

Building ���the thing wrong

Page 22: Where Bad Code Comes From
Page 23: Where Bad Code Comes From

what how code

Page 24: Where Bad Code Comes From

““When  people  are  

factored  in,    nothing  is  simple.  

Ken Schwaber

Page 25: Where Bad Code Comes From

what how

who

code

Page 26: Where Bad Code Comes From
Page 27: Where Bad Code Comes From

““A post-modern firm is rich

in information and relies heavily on the daily choices of its knowledgeable employees.

Haridimos Tsoukas

Page 28: Where Bad Code Comes From

Let’s go back in time

Page 29: Where Bad Code Comes From
Page 30: Where Bad Code Comes From
Page 31: Where Bad Code Comes From
Page 32: Where Bad Code Comes From

What’s that rustling in the bushes?

Page 33: Where Bad Code Comes From
Page 34: Where Bad Code Comes From

FIGHT

Page 35: Where Bad Code Comes From

You’re fed

Page 36: Where Bad Code Comes From

What’s that rustling in the bushes?

Page 37: Where Bad Code Comes From
Page 38: Where Bad Code Comes From

F IGHT L

Page 39: Where Bad Code Comes From

You’re safe

Page 40: Where Bad Code Comes From

back to reality

Page 41: Where Bad Code Comes From

How about that RAG report?

Page 42: Where Bad Code Comes From

Running late?

Page 43: Where Bad Code Comes From

Add more people

Page 44: Where Bad Code Comes From

Even more late *

*  Consult  the  Brooks  Law  for  details  

Page 45: Where Bad Code Comes From

How about that RAG report?

Page 46: Where Bad Code Comes From

Already over budget?

Page 47: Where Bad Code Comes From

Let’s squeeze the testing

Page 48: Where Bad Code Comes From

What do you mean quality?

Page 49: Where Bad Code Comes From

But it worked so well ���

for the 99% of the time

homo sapiens ���

have been around!

Page 50: Where Bad Code Comes From

Do you ever fly?

Page 51: Where Bad Code Comes From

? a novice pilot���or���

an experienced captain

Page 52: Where Bad Code Comes From

or perhaps even������

head of the airline safety program

Page 53: Where Bad Code Comes From

Welcome aboard KLM Flight 4805 ���

Amsterdam to Las Palmas  

Page 54: Where Bad Code Comes From

A bomb in a flower shop������������

Las Palmas closed

Page 55: Where Bad Code Comes From

Landing at Tenerife

Page 56: Where Bad Code Comes From

law mandated rest period looming

Page 57: Where Bad Code Comes From

decision to re-fuel

Page 58: Where Bad Code Comes From

and a T H I C K fog

Page 59: Where Bad Code Comes From

KLM 747 crashes ���into PanAm 747

Page 60: Where Bad Code Comes From

Communication misunderstandings

deadliest accident in aviation history

Page 61: Where Bad Code Comes From

Junior pilots any better?

remember Air France flight 447

Page 62: Where Bad Code Comes From

so how about���Software

Development

Page 63: Where Bad Code Comes From

? Ever worked ���to a tight deadline

Page 64: Where Bad Code Comes From

? Ever worked ���on a high stakes project

Page 65: Where Bad Code Comes From

? Ever worked ���with senior people

Page 66: Where Bad Code Comes From

meet Bob*���the architect

* Name changed to protect the innocent

Page 67: Where Bad Code Comes From

““Good, safe social interaction

is as necessary to successful development as good technical skills

Kent Beck

Page 68: Where Bad Code Comes From

Difficult Conversations

Page 69: Where Bad Code Comes From

Recognise���any of these…

Page 70: Where Bad Code Comes From

How do we tell… our tester

you let all these nasty

bugs through

Page 71: Where Bad Code Comes From

How do we tell… a new developer

you don’t know the

framework well enough

Page 72: Where Bad Code Comes From

How do we tell… project manager

we are not resources

Page 73: Where Bad Code Comes From

How do we tell… stakeholders

your  expectaAons  

are  unrealisAc

Page 74: Where Bad Code Comes From

How do we tell… operations

we  need  it  live  NOW

Page 75: Where Bad Code Comes From

How do we tell… our client

I am unable to add value as a coach

Page 76: Where Bad Code Comes From

we

DON’T.

Page 77: Where Bad Code Comes From

instead

Page 78: Where Bad Code Comes From

Time for ���S O L U T I O N S

Page 79: Where Bad Code Comes From

Ehm… no. ���Not today.

Page 80: Where Bad Code Comes From

I want you to learn������

and we learn best ���by doing

Page 81: Where Bad Code Comes From

““One must learn by doing the

thing; for though you think you know it, you have no certainty, until you try.

Sophocles

Page 82: Where Bad Code Comes From

so instead

Page 83: Where Bad Code Comes From

some���H O M E W O R K���

for you

Page 84: Where Bad Code Comes From

Your job

1.  Find some bad code

2.  Trace it back to a difficult conversation

3.  How could you have done it differently?���

Page 85: Where Bad Code Comes From

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

Page 86: Where Bad Code Comes From

Follow-Up

• Catch me, stop me, talk to me

• Contact me on twitter @mfloryan •  Submit and discuss your ideas

bit.ly/ace-homework

Page 87: Where Bad Code Comes From

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

Page 88: Where Bad Code Comes From

Bibliography

Page 89: Where Bad Code Comes From

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

Page 90: Where Bad Code Comes From

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

Page 91: Where Bad Code Comes From

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.

Page 92: Where Bad Code Comes From

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.