unindented code cannot possibly work!
DESCRIPTION
Presented at the DC Agile Software Engineering Conference 2012TRANSCRIPT
![Page 1: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/1.jpg)
#DCAEC12
Unindented Code Cannot Possibly Work!
Ed Buhain
December 7, 2012
PRIVILEGED AND CONFIDENTIAL. The information contained in this material is privileged and confidential, and is intended only for the use of the individual to
whom it is addressed and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this material is strictly prohibited. If you have received this material in error, please destroy it immediately. #DCAEC12
![Page 2: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/2.jpg)
#DCAEC12
The Ariane 5
$7B development
$500M rocket &
cargo
Software Based
on the Ariane 4
#DCAEC12
![Page 3: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/3.jpg)
#DCAEC12
The Ariane 5
Inertial Reference
Systems
On-Board
Computers
Boosters
&
Main Engine
#DCAEC12
![Page 4: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/4.jpg)
#DCAEC12#DCAEC12
The journey of a thousand miles
sometimes ends very, very badly.
- Despair, Inc.
![Page 5: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/5.jpg)
#DCAEC12
About Me
NAME: Ed Buhain
COMPANY: Excella Consulting
EMAIL: [email protected]
TWITTER: @buhain
BLOG: blog.buhain.com
![Page 6: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/6.jpg)
#DCAEC12
Unindented Code Cannot Possibly Work!
Ed Buhain
December 7, 2012
PRIVILEGED AND CONFIDENTIAL. The information contained in this material is privileged and confidential, and is intended only for the use of the individual to
whom it is addressed and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this material is strictly prohibited. If you have received this material in error, please destroy it immediately. #DCAEC12
![Page 7: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/7.jpg)
#DCAEC12#DCAEC12
![Page 8: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/8.jpg)
#DCAEC12
SOLID Principles
S - Single Responsibility
O - Open/Closed
Principle
L - Liskov Substitution
I - Interface Segregation
D - Dependency
Inversion
![Page 9: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/9.jpg)
#DCAEC12#DCAEC12
![Page 10: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/10.jpg)
#DCAEC12#DCAEC12
![Page 11: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/11.jpg)
#DCAEC12#DCAEC12
Unindented code cannot possibly work.
- Jeff Prosise
![Page 12: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/12.jpg)
#DCAEC12#DCAEC12
![Page 13: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/13.jpg)
#DCAEC12#DCAEC12
Success is dependent on people,
process, technology – in that order.
- Jeff Gallimore
![Page 14: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/14.jpg)
#DCAEC12
I - Passion
#DCAEC12
![Page 15: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/15.jpg)
#DCAEC12
I - Passion
#DCAEC12
![Page 16: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/16.jpg)
#DCAEC12
II – Communication
Verbal
Written
#DCAEC12
![Page 17: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/17.jpg)
#DCAEC12
II – Communication
#DCAEC12
![Page 18: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/18.jpg)
#DCAEC12#DCAEC12
Any fool can write code that a
computer can understand.
Good programmers write code that
humans can understand.
- Martin Fowler
![Page 19: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/19.jpg)
#DCAEC12
Does This Code Work?
If (productNames.Count > 0) Then lblProductName1.Text = productNames(0) lblProductName1.Visible = True End If If (productNames.Count > 1) Then lblProductName2.Text = productNames(1) lblProductName2.Visible = True End If . . . If (productNames.Count > 98) Then lblProductName99.Text = productNames(98) lblProductName99.Visible = True End If
![Page 20: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/20.jpg)
#DCAEC12
Does This Code Work?
SELECT a.CustomerName AS a, b.Address1 AS b, b.City AS c, b.PostalCode AS d, c.OrderNumber AS e FROM Customers a INNER JOIN Addresses b ON b.AddressId = a.AddressId INNER JOIN Orders c ON c.CustomerId = a.CustomerId WHERE c.IsProcessed = 0
![Page 21: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/21.jpg)
#DCAEC12
Does This Code Work?
// increment j
i++;
![Page 22: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/22.jpg)
#DCAEC12
Does This Code Work?
string iCustnm;
iCustnm = "644";
if (Cust.Has_Orders(iCustnm))
processOrders(iCustnm);
else wiatforOrdersw(iCustnm);
Display_Customer_Orders(iCustnm.ToString());
![Page 23: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/23.jpg)
#DCAEC12
III – Tools & Techniques
![Page 24: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/24.jpg)
#DCAEC12#DCAEC12
Skynet became self-aware.
- The Terminator
![Page 25: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/25.jpg)
#DCAEC12
Know Your Tools!
// Doug H. - 12/11/2010 - Bug 2733
// Rachel G. - 11/17/2010 - Bug 2544
// Doug H. - 11/11/2010 - Bug 2211
// Doug H. - 10/29/2010 - Bug 2211
// Howard W. - 8/6/2010 - Bug 2099
// Norm P. - 4/11/2010 - Bug 1556
// Doug H. - 1/14/2010 - Bug 1444
ProcessPayment(payment);
![Page 26: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/26.jpg)
#DCAEC12
Know Your Tools!
/*
*
* Edited by Doug H.
* Thursday 3:45 p.m.
* Outside Temperature 38°F
* I live at 65 Main Street.
* I wish I was on vacation. I have 6 days of vacation left.
*
*/
![Page 27: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/27.jpg)
#DCAEC12#DCAEC12
CuStOmErADDRESSid
![Page 28: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/28.jpg)
#DCAEC12
III – Tools & Techniques
Know Your Tools
Think About Presentation
#DCAEC12
![Page 29: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/29.jpg)
#DCAEC12
![Page 30: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/30.jpg)
#DCAEC12
![Page 31: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/31.jpg)
#DCAEC12
You’re Surrounded!
Think of something you think is poorly
designed.
Share with your group.
![Page 32: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/32.jpg)
#DCAEC12
Pick one or two ideas.
Share with the whole room.
We’re Surrounded!
![Page 33: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/33.jpg)
#DCAEC12
![Page 34: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/34.jpg)
#DCAEC12#DCAEC12
![Page 35: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/35.jpg)
#DCAEC12#DCAEC12
Attractive things work better.
- Donald A. Norman
![Page 36: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/36.jpg)
#DCAEC12
Know Your Patterns
![Page 37: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/37.jpg)
#DCAEC12
Know Your Patterns
![Page 38: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/38.jpg)
#DCAEC12
Know Your Patterns
![Page 39: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/39.jpg)
#DCAEC12
Know Your Patterns
![Page 40: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/40.jpg)
#DCAEC12
Know Your Patterns
![Page 41: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/41.jpg)
#DCAEC12
Know Your Patterns
![Page 42: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/42.jpg)
#DCAEC12
You are confirmed on United Airlines flight
2049, departing from Washington-Dulles
Airport at 10:00 a.m. on Friday, December
7, 2012 and arriving at Seattle-Tacoma
International Airport at 3:00 p.m.
Know Your Patterns
United Flight 2049Washington-Dulles to Seattle-
Tacoma
Departs: Fri 12/7 10:00
AM
Arrives: Fri 12/7 3:00 PM
![Page 43: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/43.jpg)
#DCAEC12
Putting It All Together…
![Page 44: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/44.jpg)
#DCAEC12
Reading List
![Page 45: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/45.jpg)
#DCAEC12
Reading List
![Page 46: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/46.jpg)
#DCAEC12#DCAEC12
What do you think about when you
hear the term legacy code?
… the sort of code that you just wish
would die.
- Michael Feathers
![Page 47: Unindented Code Cannot Possibly Work!](https://reader036.vdocuments.site/reader036/viewer/2022081603/559a02541a28abb75c8b4597/html5/thumbnails/47.jpg)
#DCAEC12
About Me
NAME: Ed Buhain
COMPANY: Excella Consulting
EMAIL: [email protected]
TWITTER: @buhain
BLOG: blog.buhain.com