unindented code cannot possibly work!

Post on 12-May-2015

187 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Unindented Code Cannot Possibly Work! was presented at the DC Agile Engineering Conference on 12/7/2012 by Ed Buhain (@buhain).

TRANSCRIPT

#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

#DCAEC12

The Ariane 5

$7B development

$500M rocket & cargo

Software Based on the Ariane 4

#DCAEC12

#DCAEC12

The Ariane 5

Inertial Reference Systems

On-BoardComputers

Boosters&

Main Engine

#DCAEC12

#DCAEC12#DCAEC12

The journey of a thousand miles sometimes ends very, very badly.

- Despair, Inc.

#DCAEC12

About Me

NAME: Ed Buhain

COMPANY: Excella Consulting

EMAIL: ed.buhain@excella.com

TWITTER: @buhain

BLOG: blog.buhain.com

#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

#DCAEC12#DCAEC12

#DCAEC12

SOLID Principles

S - Single Responsibility

O - Open/Closed Principle

L - Liskov SubstitutionI - Interface

SegregationD - Dependency

Inversion

#DCAEC12#DCAEC12

#DCAEC12#DCAEC12

#DCAEC12#DCAEC12

Unindented code cannot possibly work.

- Jeff Prosise

#DCAEC12#DCAEC12

#DCAEC12#DCAEC12

Success is dependent on people, process, technology – in that order.

- Jeff Gallimore

#DCAEC12

I - Passion

#DCAEC12

#DCAEC12

I - Passion

#DCAEC12

#DCAEC12

II – Communication

Verbal

Written

#DCAEC12

#DCAEC12

II – Communication

#DCAEC12

#DCAEC12#DCAEC12

Any fool can write code that a computer can understand.

Good programmers write code that humans can understand.

- Martin Fowler

#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

#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

#DCAEC12

Does This Code Work?

// increment j i++;

#DCAEC12

Does This Code Work?

string iCustnm; iCustnm = "644"; if (Cust.Has_Orders(iCustnm)) processOrders(iCustnm); else wiatforOrdersw(iCustnm); Display_Customer_Orders(iCustnm.ToString());

#DCAEC12

III – Tools & Techniques

#DCAEC12#DCAEC12

Skynet became self-aware.

- The Terminator

#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);

#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. * */

#DCAEC12#DCAEC12

CuStOmErADDRESSid

#DCAEC12

III – Tools & Techniques

Know Your Tools

Think About Presentation

#DCAEC12

#DCAEC12

#DCAEC12

#DCAEC12

You’re Surrounded!

Think of something you think is poorly designed.

Share with your group.

#DCAEC12

Pick a group representative.

Share with the whole room.

We’re Surrounded!

#DCAEC12

#DCAEC12#DCAEC12

#DCAEC12#DCAEC12

Attractive things work better.

- Donald A. Norman

#DCAEC12

Know Your Patterns

#DCAEC12

Know Your Patterns

#DCAEC12

Know Your Patterns

#DCAEC12

Know Your Patterns

#DCAEC12

Know Your Patterns

#DCAEC12

Know Your Patterns

#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 AMArrives: Fri 12/7 3:00 PM

#DCAEC12

Putting It All Together…

#DCAEC12

Reading List

#DCAEC12

Reading List

#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

#DCAEC12

About Me

NAME: Ed Buhain

COMPANY: Excella Consulting

EMAIL: ed.buhain@excella.com

TWITTER: @buhain

BLOG: blog.buhain.com

top related