SlideShare ist ein Scribd-Unternehmen logo
1 von 47
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-Board
      Computers




      Boosters
          &
     Main Engine

                        #DCAEC12
                          #DCAEC12
The journey of a thousand miles
sometimes ends very, very badly.
                          - Despair, Inc.




                                      #DCAEC12
                                     #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 Substitution
       I - Interface Segregation
       D - Dependency
         Inversion


                                   #DCAEC12
#DCAEC12
  #DCAEC12
#DCAEC12
  #DCAEC12
Unindented code cannot possibly work.
                          - Jeff Prosise




                                    #DCAEC12
                                   #DCAEC12
#DCAEC12
      #DCAE
Success is dependent on people,
process, technology – in that order.
                          - Jeff Gallimore




                                        #DCAEC12
                                       #DCAEC12
I - Passion




              #DCAEC12
                #DCAEC12
I - Passion




              #DCAEC12
                #DCAEC12
II – Communication

 Verbal

 Written




                     #DCAEC12
                       #DCAEC12
II – Communication




                     #DCAEC12
                      #DCAEC12
Any fool can write code that a
computer can understand.
Good programmers write code that
humans can understand.
                          - Martin Fowler



                                      #DCAEC12
                                     #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
Skynet became self-aware.
                       - The Terminator




                                    #DCAEC12
                                   #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
CuStOmErADDRESSid




                     #DCAEC12
                    #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
We’re Surrounded!

 Pick a group representative.

 Share with the whole room.




                                 #DCAEC12
#DCAEC12
#DCAEC12
#DCAEC12
Attractive things work better.
                       - Donald A. Norman




                                      #DCAEC12
                                     #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
Know Your Patterns

 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.
        United Flight 2049
        Washington-Dulles to Seattle-
        Tacoma

        Departs:     Fri 12/7     10:00
        AM                                #DCAEC12
Putting It All Together…




                           #DCAEC12
Reading List




               #DCAEC12
Reading List




               #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
                                      #DCAEC12
About Me

   NAME:      Ed Buhain

   COMPANY:   Excella Consulting

   EMAIL:     ed.buhain@excella.com

   TWITTER:   @buhain

   BLOG:      blog.buhain.com
                                      #DCAEC12

Weitere ähnliche Inhalte

Andere mochten auch

чужинова нв, шляхтина он
чужинова нв, шляхтина ончужинова нв, шляхтина он
чужинова нв, шляхтина онchuginova
 
HSL Presentation
HSL PresentationHSL Presentation
HSL PresentationNaian Chang
 
Scatol8 UUDD_livello A_5
Scatol8 UUDD_livello A_5Scatol8 UUDD_livello A_5
Scatol8 UUDD_livello A_5Scatol8
 
Overloading in java with example
Overloading in java with exampleOverloading in java with example
Overloading in java with examplekalkanpal
 
Ad mark presentation1
Ad mark presentation1Ad mark presentation1
Ad mark presentation1Michael Neely
 
Calculo -purcell_(preliminar)
Calculo  -purcell_(preliminar)Calculo  -purcell_(preliminar)
Calculo -purcell_(preliminar)Araceli Nano
 
Superman #2 [thaicomix]
Superman  #2 [thaicomix]Superman  #2 [thaicomix]
Superman #2 [thaicomix]thaicomix
 
[CLP] IT industry Day 2 - 3
[CLP] IT industry  Day 2 - 3[CLP] IT industry  Day 2 - 3
[CLP] IT industry Day 2 - 3Junhyuk Lee
 
Skin nova presentatsioon 2013
Skin nova presentatsioon 2013Skin nova presentatsioon 2013
Skin nova presentatsioon 2013Maarja Tali
 

Andere mochten auch (16)

чужинова нв, шляхтина он
чужинова нв, шляхтина ончужинова нв, шляхтина он
чужинова нв, шляхтина он
 
HSL Presentation
HSL PresentationHSL Presentation
HSL Presentation
 
Imma
ImmaImma
Imma
 
Target
TargetTarget
Target
 
math
mathmath
math
 
Scatol8 UUDD_livello A_5
Scatol8 UUDD_livello A_5Scatol8 UUDD_livello A_5
Scatol8 UUDD_livello A_5
 
W poszukiwaniu swojej drogi - webinar
W poszukiwaniu swojej drogi - webinarW poszukiwaniu swojej drogi - webinar
W poszukiwaniu swojej drogi - webinar
 
Overloading in java with example
Overloading in java with exampleOverloading in java with example
Overloading in java with example
 
Ad mark presentation1
Ad mark presentation1Ad mark presentation1
Ad mark presentation1
 
Sodium hypo
Sodium hypoSodium hypo
Sodium hypo
 
Calculo -purcell_(preliminar)
Calculo  -purcell_(preliminar)Calculo  -purcell_(preliminar)
Calculo -purcell_(preliminar)
 
Superman #2 [thaicomix]
Superman  #2 [thaicomix]Superman  #2 [thaicomix]
Superman #2 [thaicomix]
 
[CLP] IT industry Day 2 - 3
[CLP] IT industry  Day 2 - 3[CLP] IT industry  Day 2 - 3
[CLP] IT industry Day 2 - 3
 
Tmđt
TmđtTmđt
Tmđt
 
Skin nova presentatsioon 2013
Skin nova presentatsioon 2013Skin nova presentatsioon 2013
Skin nova presentatsioon 2013
 
Saludos navideños docentes
Saludos navideños docentesSaludos navideños docentes
Saludos navideños docentes
 

Ähnlich wie Unindented Code Cannot Possibly Work

Better Nonprofit Websites: 52 Tweaks in 52 Weeks
Better Nonprofit Websites: 52 Tweaks in 52 WeeksBetter Nonprofit Websites: 52 Tweaks in 52 Weeks
Better Nonprofit Websites: 52 Tweaks in 52 WeeksNTEN
 
The Technical Debt Trap
The Technical Debt TrapThe Technical Debt Trap
The Technical Debt TrapDoc Norton
 
the best code, is code never written
the best code, is code never writtenthe best code, is code never written
the best code, is code never writtenDaniel Davis
 
Living documentation
Living documentationLiving documentation
Living documentationSamuel ROZE
 
CIS13: Identity—The Great Enabler of Next
CIS13: Identity—The Great Enabler of NextCIS13: Identity—The Great Enabler of Next
CIS13: Identity—The Great Enabler of NextCloudIDSummit
 
Leading Without Formal Authority -- By Using Data
Leading Without Formal Authority -- By Using DataLeading Without Formal Authority -- By Using Data
Leading Without Formal Authority -- By Using DataTerri Griffith
 
42629 lecture 12 pt3
42629 lecture 12 pt342629 lecture 12 pt3
42629 lecture 12 pt3Tom Howard
 
Measuring Influence at Digital Futures 2012
Measuring Influence at Digital Futures 2012Measuring Influence at Digital Futures 2012
Measuring Influence at Digital Futures 2012bloomagencyleeds
 
Start with your end picture in clear focus and other on point it project mana...
Start with your end picture in clear focus and other on point it project mana...Start with your end picture in clear focus and other on point it project mana...
Start with your end picture in clear focus and other on point it project mana...Stoneseed Ltd
 
Building Blocks of a Knowledge Work Culture - NDC London 2016
Building Blocks of a Knowledge Work Culture - NDC London 2016Building Blocks of a Knowledge Work Culture - NDC London 2016
Building Blocks of a Knowledge Work Culture - NDC London 2016Doc Norton
 
The 7 Dwarfs of Social Media: Enchanting Your Audience
The 7 Dwarfs of Social Media: Enchanting Your AudienceThe 7 Dwarfs of Social Media: Enchanting Your Audience
The 7 Dwarfs of Social Media: Enchanting Your AudienceKiKi L'Italien
 
The Unfortunate Triumph of Process over Purpose
The Unfortunate Triumph of Process over PurposeThe Unfortunate Triumph of Process over Purpose
The Unfortunate Triumph of Process over PurposeTechWell
 
Class 2: Setting the foundation for a successful website design
Class 2: Setting the foundation for a successful website designClass 2: Setting the foundation for a successful website design
Class 2: Setting the foundation for a successful website designDon Stanley
 
Visual tools for the sp ia sp intersections - nov 2014
Visual tools for the sp ia    sp intersections - nov 2014Visual tools for the sp ia    sp intersections - nov 2014
Visual tools for the sp ia sp intersections - nov 2014Ruven Gotz
 
BDD in open source projects - Is it really beneficial?
BDD in open source projects - Is it really beneficial?BDD in open source projects - Is it really beneficial?
BDD in open source projects - Is it really beneficial?Fabian Kiss
 
Truly Responsive Design Means Aligning to Business and User Goals
Truly Responsive Design Means Aligning to Business and User GoalsTruly Responsive Design Means Aligning to Business and User Goals
Truly Responsive Design Means Aligning to Business and User GoalsJohn Eckman
 
Thinking hard about_python
Thinking hard about_pythonThinking hard about_python
Thinking hard about_pythonDaniel Greenfeld
 
2012 get socialordietrying soccnx4
2012 get socialordietrying soccnx42012 get socialordietrying soccnx4
2012 get socialordietrying soccnx4Roman Weber
 
Open Web Technologies and You - Durham College Student Integration Presentation
Open Web Technologies and You - Durham College Student Integration PresentationOpen Web Technologies and You - Durham College Student Integration Presentation
Open Web Technologies and You - Durham College Student Integration Presentationdarryl_lehmann
 
Big guns for small guys (reloaded)
Big guns for small guys (reloaded)Big guns for small guys (reloaded)
Big guns for small guys (reloaded)Jorge López-Lago
 

Ähnlich wie Unindented Code Cannot Possibly Work (20)

Better Nonprofit Websites: 52 Tweaks in 52 Weeks
Better Nonprofit Websites: 52 Tweaks in 52 WeeksBetter Nonprofit Websites: 52 Tweaks in 52 Weeks
Better Nonprofit Websites: 52 Tweaks in 52 Weeks
 
The Technical Debt Trap
The Technical Debt TrapThe Technical Debt Trap
The Technical Debt Trap
 
the best code, is code never written
the best code, is code never writtenthe best code, is code never written
the best code, is code never written
 
Living documentation
Living documentationLiving documentation
Living documentation
 
CIS13: Identity—The Great Enabler of Next
CIS13: Identity—The Great Enabler of NextCIS13: Identity—The Great Enabler of Next
CIS13: Identity—The Great Enabler of Next
 
Leading Without Formal Authority -- By Using Data
Leading Without Formal Authority -- By Using DataLeading Without Formal Authority -- By Using Data
Leading Without Formal Authority -- By Using Data
 
42629 lecture 12 pt3
42629 lecture 12 pt342629 lecture 12 pt3
42629 lecture 12 pt3
 
Measuring Influence at Digital Futures 2012
Measuring Influence at Digital Futures 2012Measuring Influence at Digital Futures 2012
Measuring Influence at Digital Futures 2012
 
Start with your end picture in clear focus and other on point it project mana...
Start with your end picture in clear focus and other on point it project mana...Start with your end picture in clear focus and other on point it project mana...
Start with your end picture in clear focus and other on point it project mana...
 
Building Blocks of a Knowledge Work Culture - NDC London 2016
Building Blocks of a Knowledge Work Culture - NDC London 2016Building Blocks of a Knowledge Work Culture - NDC London 2016
Building Blocks of a Knowledge Work Culture - NDC London 2016
 
The 7 Dwarfs of Social Media: Enchanting Your Audience
The 7 Dwarfs of Social Media: Enchanting Your AudienceThe 7 Dwarfs of Social Media: Enchanting Your Audience
The 7 Dwarfs of Social Media: Enchanting Your Audience
 
The Unfortunate Triumph of Process over Purpose
The Unfortunate Triumph of Process over PurposeThe Unfortunate Triumph of Process over Purpose
The Unfortunate Triumph of Process over Purpose
 
Class 2: Setting the foundation for a successful website design
Class 2: Setting the foundation for a successful website designClass 2: Setting the foundation for a successful website design
Class 2: Setting the foundation for a successful website design
 
Visual tools for the sp ia sp intersections - nov 2014
Visual tools for the sp ia    sp intersections - nov 2014Visual tools for the sp ia    sp intersections - nov 2014
Visual tools for the sp ia sp intersections - nov 2014
 
BDD in open source projects - Is it really beneficial?
BDD in open source projects - Is it really beneficial?BDD in open source projects - Is it really beneficial?
BDD in open source projects - Is it really beneficial?
 
Truly Responsive Design Means Aligning to Business and User Goals
Truly Responsive Design Means Aligning to Business and User GoalsTruly Responsive Design Means Aligning to Business and User Goals
Truly Responsive Design Means Aligning to Business and User Goals
 
Thinking hard about_python
Thinking hard about_pythonThinking hard about_python
Thinking hard about_python
 
2012 get socialordietrying soccnx4
2012 get socialordietrying soccnx42012 get socialordietrying soccnx4
2012 get socialordietrying soccnx4
 
Open Web Technologies and You - Durham College Student Integration Presentation
Open Web Technologies and You - Durham College Student Integration PresentationOpen Web Technologies and You - Durham College Student Integration Presentation
Open Web Technologies and You - Durham College Student Integration Presentation
 
Big guns for small guys (reloaded)
Big guns for small guys (reloaded)Big guns for small guys (reloaded)
Big guns for small guys (reloaded)
 

Mehr von DC Agile Engineering Conference (6)

Working with Legacy Code
Working with Legacy CodeWorking with Legacy Code
Working with Legacy Code
 
Lead by Example
Lead by ExampleLead by Example
Lead by Example
 
Continuous Integration: Toolbox, Blueprint, Master Craft
Continuous Integration: Toolbox, Blueprint, Master CraftContinuous Integration: Toolbox, Blueprint, Master Craft
Continuous Integration: Toolbox, Blueprint, Master Craft
 
Continuous Delivery Applied
Continuous Delivery AppliedContinuous Delivery Applied
Continuous Delivery Applied
 
Agile Engineering and Software Craftsmanship
Agile Engineering and Software CraftsmanshipAgile Engineering and Software Craftsmanship
Agile Engineering and Software Craftsmanship
 
Improving Design through TDD
Improving Design through TDDImproving Design through TDD
Improving Design through TDD
 

Kürzlich hochgeladen

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Kürzlich hochgeladen (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Unindented Code Cannot Possibly Work

  • 1. 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
  • 2. The Ariane 5  $7B development  $500M rocket & cargo  Software Based on the Ariane 4 #DCAEC12 #DCAEC12
  • 3. The Ariane 5 Inertial Reference Systems On-Board Computers Boosters & Main Engine #DCAEC12 #DCAEC12
  • 4. The journey of a thousand miles sometimes ends very, very badly.  - Despair, Inc. #DCAEC12 #DCAEC12
  • 5. About Me NAME: Ed Buhain COMPANY: Excella Consulting EMAIL: ed.buhain@excella.com TWITTER: @buhain BLOG: blog.buhain.com #DCAEC12
  • 6. 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
  • 8. SOLID Principles S - Single Responsibility O - Open/Closed Principle L - Liskov Substitution I - Interface Segregation D - Dependency Inversion #DCAEC12
  • 11. Unindented code cannot possibly work.  - Jeff Prosise #DCAEC12 #DCAEC12
  • 12. #DCAEC12 #DCAE
  • 13. Success is dependent on people, process, technology – in that order.  - Jeff Gallimore #DCAEC12 #DCAEC12
  • 14. I - Passion #DCAEC12 #DCAEC12
  • 15. I - Passion #DCAEC12 #DCAEC12
  • 16. II – Communication  Verbal  Written #DCAEC12 #DCAEC12
  • 17. II – Communication #DCAEC12 #DCAEC12
  • 18. Any fool can write code that a computer can understand. Good programmers write code that humans can understand.  - Martin Fowler #DCAEC12 #DCAEC12
  • 19. 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
  • 20. 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
  • 21. Does This Code Work? // increment j i++; #DCAEC12
  • 22. Does This Code Work? string iCustnm; iCustnm = "644"; if (Cust.Has_Orders(iCustnm)) processOrders(iCustnm); else wiatforOrdersw(iCustnm); Display_Customer_Orders(iCustnm.ToString()); #DCAEC12
  • 23. III – Tools & Techniques #DCAEC12
  • 24. Skynet became self-aware.  - The Terminator #DCAEC12 #DCAEC12
  • 25. 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
  • 26. 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
  • 27. CuStOmErADDRESSid #DCAEC12 #DCAEC12
  • 28. III – Tools & Techniques  Know Your Tools  Think About Presentation #DCAEC12 #DCAEC12
  • 31. You’re Surrounded!  Think of something you think is poorly designed.  Share with your group. #DCAEC12
  • 32. We’re Surrounded!  Pick a group representative.  Share with the whole room. #DCAEC12
  • 35. Attractive things work better.  - Donald A. Norman #DCAEC12 #DCAEC12
  • 36. Know Your Patterns #DCAEC12
  • 37. Know Your Patterns #DCAEC12
  • 38. Know Your Patterns #DCAEC12
  • 39. Know Your Patterns #DCAEC12
  • 40. Know Your Patterns #DCAEC12
  • 41. Know Your Patterns #DCAEC12
  • 42. Know Your Patterns  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. United Flight 2049 Washington-Dulles to Seattle- Tacoma Departs: Fri 12/7 10:00 AM #DCAEC12
  • 43. Putting It All Together… #DCAEC12
  • 44. Reading List #DCAEC12
  • 45. Reading List #DCAEC12
  • 46. 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 #DCAEC12
  • 47. About Me NAME: Ed Buhain COMPANY: Excella Consulting EMAIL: ed.buhain@excella.com TWITTER: @buhain BLOG: blog.buhain.com #DCAEC12

Hinweis der Redaktion

  1. June 4, 1996
  2. S - single responsibility - objects should do only one thingO - open/closed principle - entities should be open for extension, closed for modificationL - Liskov substitution - objects should be replaceable with subtypes without altering correctnessI - interface segregation - many client-specific interfaces are better than one general-purpose interfaceD - dependency inversion - depend upon abstractions, not concretions
  3. One of the partners at Excella Consulting compiled a list of observations about the work we do. One of the observations he noted (#17): Success is dependent on people, process, and technology. In that order.
  4. In the interview, I often ask a lot of questions to find out how much someone loves developing software or working with computers.How many computers do you have?Physical or virtual?What do you do to learn about new technologies?Do you play any MMORPGs?I want people who are passionate about computers and software engineering. I want someone who would choose to do the same thing in their free time.
  5. I look for people with great communication skills. Verbal communications, for one.Gregg Boer, Program Manager, TFS – “The Greatest Estimate”
  6. Here’s a sample resumeI received – the name’s been changed, of course.
  7. Here’s a classic debate. Are code comments good or bad?I personally prefer to use comments sparingly – I want the code to be self-documenting through the use of readable identifiers with whitespace and indentation to provide emphasis.
  8. Does this code work? Maybe it produces the right output, but that's only half of the evaluation criteria. This code fails because it doesn't properly communicate what it's supposed to do.
  9. The third thing I look for is how well candidates know their tools and techniques. You will be judged on your mastery of tools and patterns.
  10. Learn what your tools do well; learn what your tools do not do well.
  11. Some people get really verbose when they’re filling in comments. This snippet was inspired by someone I worked with who had a habit of including random personal information in his comments.Speaking of tools, don't rely so much on them that it keeps you from writing good software.Don't confuse Intellisense with spell check. If you spell it wrong the first time, it'll help you spell it wrong every time.
  12. Same thing goes with ORM. If you spelled your column name like this <sample>, your class names are going to look like this.Tools are not a substitute for thinking.
  13. Speaking of techniques, you’re also going to be judged on your presentation.
  14. Here’s a door from Excella's main office in Arlington.Which way does the door open?It's a really nice office, but here, we sacrificed obvious cues for the sake of beauty and symmetry -- or at least conforming to the design standards of the building. We're used to cues that tell us whether to (gesture) push or pull.When we first moved in, I noticed one of Excella's partners looking up every time he approached a doorway. He was looking for the only visual cue we have…
  15. … the door stop at the top of the door.Someone gave me a helpful mnemonic. The main doors in the office open away from the main space. Should your users have to make up mnemonics because you forgot to think about how they'd use your software?
  16. Now pick someone to represent your little group. We'll go around the room and just shout out some of the ideas.
  17. Here’s my opportunity to complain about consistency.
  18. They put a lot of thought into the airport signage at Schiphol.Color coding: Color should make sense and clearly communicate an information category.Terminology: Assume that visitors know nothing about the facility and use terminology that is easily understandable to everyone. Fonts: Don’t use more than one font, and stick to such sans-serif typefaces as Frutiger, Clearview, Gill or Meta. Pictograms: Don’t rely too much on pictograms; supplement with text, especially with less familiar functions.
  19. The back-end code for your software could be amazing, but if your user interface looks like you rushed to put it together, people will assume that you rushed the whole thing.
  20. Have you ever built THE FORM? Have you ever thought it was a good idea?When this stuff was new, it was pretty neat. You could throw something like this together pretty quickly.Our needs have evolved. THE FORM might work, sure, but there are so many things wrong with the form
  21. I worked on one project (actually the same one as the last one) where I couldn’t figure out why my data didn’t save when I clicked OK. It turns out I was supposed to click Apply / Cancel. Aren’t those supposed to be equivalent?Have you ever run into software where they switch OK and Cancel? I’m so used to that order that I’ll click the wrong one if you switch it around
  22. Here’s something from a site that completely blew me away. I’m used to seeing Login and Password – this site had them switched around.
  23. Know Your Users’ Patterns (Expect the Unexpected!)The Therac-25 was a state-of-the-art cancer treatment system designed to deliver radiation with pinpoint accuracy.It had two treatment modes: a high-power x-ray mode and a low-power electron beam mode.X-ray mode fired 25,000 rads of radiation. To switch to x-ray mode, you typed an “X” into a field and a thick metal plate automatically deployed to transform the radiation beam into lower-intensity x-rays.Electron beam mode fired 200 rads. You entered an “E” to activate it.The operator pushed X accidentally, but used an unexpected key combination to change it – up arrow to select “edit” and change from “x-ray” to “electron beam” mode, then return to get back to the bottom of the screen.This sequence had never been tested. The screen showed “electron beam” mode – the metal plate was retracted, but the power setting remained at maximum.There was a video camera in the treatment room, but the control room monitor wasn’t plugged in.beam fired, blue flash, excruciating pain. control room displayed "Malfunction 54" -- operator fired beam again.Cherenkov radiation caused by acceleration of a stream of electrons."Captain Kirk forgot to put the machine on stun.“2/38.5
  24. If we were to be agile when it comes to UI…We’re conditioned to look for structured data. Specific information vs. natural language prose.Prose vs. Tables - Airline ReservationCut the fluff!
  25. Who’s gone through an app certification process? Polishing your app might take longer than the functionality!I recently went through the Windows 8 certification process and they’re cracking down on some of these patterns. I’ve shown you a few of the smells that could make your customers, your users, your bosses cringe – and I want you to recognize them, too, because that’s how you’ll deliver good software.
  26. Set Phasers on Stun by Stephen CaseyClean Code by Robert C. MartinThe Design of Everyday Things by Donald A. NormanDesigning with the Mind in Mind by Jeff JohnsonUrsEnzler – Clean Code and Clean TDD Cheat Sheets
  27. UrsEnzler – Clean Code and TDD Cheat SheetsSo… we’ve learned how to identify and how to avoid code smells, but what happens when you have to work with a code base filled with code smells?
  28. Roberto Hernandez is up next to tell you all about how we deal with legacy code.