Where Bad Code Comes From
-
Upload
marcin-floryan -
Category
Technology
-
view
711 -
download
0
description
Transcript of Where Bad Code Comes From
![Page 1: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/1.jpg)
Where Bad Code Comes From? June 2012
![Page 2: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/2.jpg)
I’m Marcin Floryan http://marcin.floryan.pl
![Page 3: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/3.jpg)
Energized Work @mfloryan Value, Flow, Quality
You can find me at:
![Page 4: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/4.jpg)
The ACE Conference:
This presentation:
#aceconf
#mfbadcode
![Page 5: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/5.jpg)
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](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/6.jpg)
Any developers in the room?
![Page 7: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/7.jpg)
Seen any bad code?
![Page 8: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/8.jpg)
? Experienced ���any bad code
![Page 9: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/9.jpg)
![Page 10: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/10.jpg)
? how bad can it get
![Page 11: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/11.jpg)
Mariner 1
$18.5 million
![Page 12: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/12.jpg)
Hartford Coliseum
$80 million
![Page 13: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/13.jpg)
Ariane 5
$500 million
![Page 14: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/14.jpg)
““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](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/15.jpg)
North America black-out
55 million people
![Page 16: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/16.jpg)
““To err is human, but to
really foul things up you need a computer.
Paul Ehrlich
![Page 17: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/17.jpg)
Does your code resemble ���this
![Page 18: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/18.jpg)
or this…?
![Page 19: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/19.jpg)
Building ���the wrong thing
![Page 20: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/20.jpg)
![Page 21: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/21.jpg)
Building ���the thing wrong
![Page 22: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/22.jpg)
![Page 23: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/23.jpg)
what how code
![Page 24: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/24.jpg)
““When people are
factored in, nothing is simple.
Ken Schwaber
![Page 25: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/25.jpg)
what how
who
code
![Page 26: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/26.jpg)
![Page 27: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/27.jpg)
““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](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/28.jpg)
Let’s go back in time
![Page 29: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/29.jpg)
![Page 30: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/30.jpg)
![Page 31: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/31.jpg)
![Page 32: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/32.jpg)
What’s that rustling in the bushes?
![Page 33: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/33.jpg)
![Page 34: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/34.jpg)
FIGHT
![Page 35: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/35.jpg)
You’re fed
![Page 36: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/36.jpg)
What’s that rustling in the bushes?
![Page 37: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/37.jpg)
![Page 38: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/38.jpg)
F IGHT L
![Page 39: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/39.jpg)
You’re safe
![Page 40: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/40.jpg)
back to reality
![Page 41: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/41.jpg)
How about that RAG report?
![Page 42: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/42.jpg)
Running late?
![Page 43: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/43.jpg)
Add more people
![Page 44: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/44.jpg)
Even more late *
* Consult the Brooks Law for details
![Page 45: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/45.jpg)
How about that RAG report?
![Page 46: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/46.jpg)
Already over budget?
![Page 47: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/47.jpg)
Let’s squeeze the testing
![Page 48: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/48.jpg)
What do you mean quality?
![Page 49: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/49.jpg)
But it worked so well ���
for the 99% of the time
homo sapiens ���
have been around!
![Page 50: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/50.jpg)
Do you ever fly?
![Page 51: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/51.jpg)
? a novice pilot���or���
an experienced captain
![Page 52: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/52.jpg)
or perhaps even������
head of the airline safety program
![Page 53: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/53.jpg)
Welcome aboard KLM Flight 4805 ���
Amsterdam to Las Palmas
![Page 54: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/54.jpg)
A bomb in a flower shop������������
Las Palmas closed
![Page 55: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/55.jpg)
Landing at Tenerife
![Page 56: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/56.jpg)
law mandated rest period looming
![Page 57: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/57.jpg)
decision to re-fuel
![Page 58: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/58.jpg)
and a T H I C K fog
![Page 59: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/59.jpg)
KLM 747 crashes ���into PanAm 747
![Page 60: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/60.jpg)
Communication misunderstandings
deadliest accident in aviation history
![Page 61: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/61.jpg)
Junior pilots any better?
remember Air France flight 447
![Page 62: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/62.jpg)
so how about���Software
Development
![Page 63: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/63.jpg)
? Ever worked ���to a tight deadline
![Page 64: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/64.jpg)
? Ever worked ���on a high stakes project
![Page 65: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/65.jpg)
? Ever worked ���with senior people
![Page 66: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/66.jpg)
meet Bob*���the architect
* Name changed to protect the innocent
![Page 67: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/67.jpg)
““Good, safe social interaction
is as necessary to successful development as good technical skills
Kent Beck
![Page 68: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/68.jpg)
Difficult Conversations
![Page 69: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/69.jpg)
Recognise���any of these…
![Page 70: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/70.jpg)
How do we tell… our tester
you let all these nasty
bugs through
![Page 71: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/71.jpg)
How do we tell… a new developer
you don’t know the
framework well enough
![Page 72: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/72.jpg)
How do we tell… project manager
we are not resources
![Page 73: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/73.jpg)
How do we tell… stakeholders
your expectaAons
are unrealisAc
![Page 74: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/74.jpg)
How do we tell… operations
we need it live NOW
![Page 75: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/75.jpg)
How do we tell… our client
I am unable to add value as a coach
![Page 76: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/76.jpg)
we
DON’T.
![Page 77: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/77.jpg)
instead
![Page 78: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/78.jpg)
Time for ���S O L U T I O N S
![Page 79: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/79.jpg)
Ehm… no. ���Not today.
![Page 80: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/80.jpg)
I want you to learn������
and we learn best ���by doing
![Page 81: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/81.jpg)
““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](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/82.jpg)
so instead
![Page 83: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/83.jpg)
some���H O M E W O R K���
for you
![Page 84: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/84.jpg)
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](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/85.jpg)
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](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/86.jpg)
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](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/87.jpg)
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](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/88.jpg)
Bibliography
![Page 89: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/89.jpg)
So Thank You bit.ly/ace-bad-code
![Page 90: Where Bad Code Comes From](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/90.jpg)
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](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/91.jpg)
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](https://reader033.fdocuments.net/reader033/viewer/2022042713/548d9618b47959640d8b47ed/html5/thumbnails/92.jpg)
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.