SlideShare a Scribd company logo
Code Excellence
            for the
Average Programmer

  By Llewellyn Falco & Woody Zuill
How many are working
  with legacy code?




                 2
Code Excellence for the Average Programmer
Code Excellence for the Average Programmer
VS
Goal:
Simple Techniques
for Code Excellence
Project:
Charting Project




                   6
the golden rule
Leave things BETTER
than you found them
Never be more than 2 minutes away
 from checking in and going home
Arm Yourself
Arm Yourself
Tests
Arm Yourself
Tests
Tools
Arm Yourself
Tests
Tools
Patterns
What makes code
hard to work with?
Remove the 3 C’s...
Remove the 3 C’s...
   Clutter
Remove the 3 C’s...
   Clutter
   Complexity
Remove the 3 C’s...
   Clutter
   Complexity
   Cleverness
Removing Clutter
Definition : Clutter is anything in your code that does
                      not add value.
Removing Clutter
Definition : Clutter is anything in your code that does
                      not add value.



      Format your code
Removing Clutter
Definition : Clutter is anything in your code that does
                      not add value.



      Format your code
      Delete comments
Removing Clutter
Definition : Clutter is anything in your code that does
                      not add value.



      Format your code
      Delete comments
      Delete dead code
Removing Clutter
Definition : Clutter is anything in your code that does
                      not add value.



      Format your code
      Delete comments
      Delete dead code
      Delete unnecessary code
Code Excellence for the Average Programmer
Code Excellence for the Average Programmer
Code Excellence for the Average Programmer
Code Excellence for the Average Programmer
Code Excellence for the Average Programmer
Code Excellence for the Average Programmer
Code Excellence for the Average Programmer
Code Excellence for the Average Programmer
Code Excellence for the Average Programmer
Removing Complexity
Removing Complexity
 Bad Names
Removing Complexity
 Bad Names
 Long Methods
Removing Complexity
 Bad Names
 Long Methods
 Deep Conditionals (if/for/while/switch)
Removing Complexity
 Bad Names
 Long Methods
 Deep Conditionals (if/for/while/switch)
 Magic Numbers
Removing Complexity
 Bad Names
 Long Methods
 Deep Conditionals (if/for/while/switch)
 Magic Numbers
 Improper Variable Scoping
Removing Complexity
 Bad Names
 Long Methods
 Deep Conditionals (if/for/while/switch)
 Magic Numbers
 Improper Variable Scoping
 Missing Encapsulation
Removing Complexity
 Bad Names
 Long Methods
 Deep Conditionals (if/for/while/switch)
 Magic Numbers
 Improper Variable Scoping
 Missing Encapsulation
 Obscure Code Blocks
Removing Cleverness
 “If it’s simple and elegant, you wouldn’t refer to it
                      as ‘clever’”
Removing Cleverness
 “If it’s simple and elegant, you wouldn’t refer to it
                      as ‘clever’”


   Cryptic Code
Removing Cleverness
 “If it’s simple and elegant, you wouldn’t refer to it
                      as ‘clever’”


   Cryptic Code
   Abbreviated Code
Removing Cleverness
 “If it’s simple and elegant, you wouldn’t refer to it
                      as ‘clever’”


  Cryptic Code
  Abbreviated Code
  Hijacking a Method(changing its intent for your
own purposes)
... and the 3 D’s
... and the 3 D’s
    Duplication
... and the 3 D’s
    Duplication
    Duplication
... and the 3 D’s
    Duplication
    Duplication
    Duplication
Our code base is just
a big mess, and no
one is happy working
in it.
Code Excellence for the Average Programmer
Next Steps




:-)




             1-2
Next Steps
Spring Cleaning Week - Start
each task with 25 minutes of
cleaning with a co-worker.
:-)




                           1-2
Next Steps




             2-2
Next Steps
Books




             2-2
Next Steps
Books
‘Clean Code’ by Robert Martin




                                2-2
Next Steps
Books
‘Clean Code’ by Robert Martin
‘Working Effectively with
Legacy Code’ by Michael Feathers


                             2-2
What we offer
What we offer
• Day Classes on site
 •Single day class to educate & train employees
 on a single aspect of agile
What we offer
• Day Classes on site
    •Single day class to educate & train employees
    on a single aspect of agile

•   On site Coaching
    •Minimum 2 weeks working on site with
    employees on their stuff.
    •Training/Mentoring
    •Setup of framework
       •Source Control
       •Automated Builds
       •Continuous integration
       •Work environment
www.ApprovalTests.com
     check here for more information
   about how we actually tested the code
Contact

           Woody Zuill
          wzuill@yahoo.com



  Llewellyn Falco
   info@spunlabs.com
Goal:
Simple Techniques
for Code Excellence

More Related Content

Code Excellence for the Average Programmer