SlideShare une entreprise Scribd logo
1  sur  66
Télécharger pour lire hors ligne
Silicon Valley
                      Code Camp



 Clean Code
Why Clean Code matters

    Foothill College, October 9nd 2011
Theo Jungeblut
• Senior Software Developer at
  Omnicell Inc. in Mountain View
• Has been designing and
  implementing .NET based
  applications , components and
  frameworks for more than 8 years
• Previously worked in factory
  automation with focus on
  component based software and
  framework development for 3 ½
  years
                                     theo@csharp-lighthouse.com
• Degree in Software Engineering
  and Network Communications         www.csharp-lighthouse.com
Overview
• Why Clean Code
• Tools
       •   Resharper
       •   FxCop, StyleCop & StyleCop plugin for Resharper
       •   GhostDoc & Spell Checker
       •   Code Contracts, Pex & Moles
•   Clean Code Developer Initiative
•   Principles and Practices
•   Code Comparison
•   Q&A
Does writing Clean Code
make us more efficient?
What is Clean Code?
Clean Code is maintainable

     Source code must be:
     • readable & well structured
     • extensible
     • testable
Software
 Engineering
      vs.
Craftsmanship
The “Must Read”-Book(s)
 by Robert C Martin


A Handbook of Agile
Software
Craftsmanship

“Even bad code can
function. But if code
isn’t clean, it can bring a
development
organization to its
knees.”
Code Maintainability *
    Principles                   Patterns                   Containers


       Why?                        How?                        What?


  Extensibility                Clean Code                   Tool reuse

* from: Mark Seemann’s “Dependency Injection in .NET” presentation Bay.NET 05/2011
.NET Tools and their Impact
Tool name        Positive Impact           Negative Impact
Resharper        compiling ++++            VS responsiveness --
FxCop            code quality ++           compiling time -
StyleCop         code consistency +++      compiling time -
StyleCop plugin compiling time +++         VS responsiveness --
for Resharper
Ghost Doc        automated docs            potentially worse doc
Spell Checker    fewer spelling errors ++ performance --
Code Contracts   testability, quality ++   compiling time --
Pex & Moles      automated test ++         compiling time --
Resharper
“The single most impacting development
        addition to Visual Studio”
     Features:
       –   Code Analysis
       –   Quick Fixes
       –   Code Templates
       –   Code Generation
       –   Code Cleanup
       –   Many, many more…
                              http://www.jetbrains.com/resharper/
FxCop / Static Code Analysis
  Code Analysis:
    – Correctness
    – Library design
    – Internationalization and localization
    – Naming conventions
    – Performance
    – Security


              http://msdn.microsoft.com/en-us/library/3z0aeatx.aspx
Style Cop with R# Integration
   Code Consistency & Readability:
     – Automated check of C# coding
       standard
     – Enforceable at check-in with TFS
       check-in Policy

     – Full Integration in Resharper with
       Style Cop plugin:
     – Code Analysis
     – Quick Fixes
     – Code Cleanup
Ghost Doc

• Save keystrokes and time
• Simplify documenting your code
• Benefit of the base class documentation




          http://submain.com/products/ghostdoc.aspx
Spell Checker

  • Spelll chicking for literals and comments in VS




http://visualstudiogallery.msdn.microsoft.com/7c8341f1-ebac-40c8-92c2-476db8d523ce/
•   Design-by-Contract programming
•   Improved testability
•   Static verification
•   API documentation integration with
    Sandcastle
    http://msdn.microsoft.com/en-us/devlabs/dd491992
Microsoft Pex & Moles


• Pex automatically generates test suites with
  high code coverage.

• Moles allows to replace any .NET method with
  a delegate.


          http://research.microsoft.com/en-us/projects/pex/
Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
Clean Code Developer – 1st Iteration
     by Ralf Westphal & Stefan Lieser – http://www.clean-code-developer.de




Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
Keep it simple, stupid
        (KISS)
KISS-Principle – “Keep It Simple Stupid”
   by Kelly Johnson




                      http://blogs.smarter.com/blogs/Lego%20Brick.jpg
The Power of Simplicity




                                                       Graphic by Nathan Sawaya courtesy of brickartist.com




Graphic by Nathan Sawaya courtesy of brickartist.com

                                                                                http://www.geekalerts.com/lego-iphone/
Graphic by Nathan Sawaya courtesy of brickartist.com
Don’t repeat yourself
        (DRY)
Don’t repeat yourself (DRY)
        by Andy Hunt and Dave Thomas in their book “The Pragmatic Programmer”

// Code Copy and Paste Method                                                    // DRY Method
public Class Person                                                              public Class Person
 {                                                                                {
   public string FirstName { get; set;}                                             public string FirstName { get; set;}
   public string LastName { get; set;}                                              public string LastName { get; set;}

    public Person(Person person)                                                     public Person(Person person)
    {                                                                                {
      this.FirstName = string.IsNullOrEmpty(person.FirstName)                          this.FirstName = person.FirstName.CloneSecured();
                 ? string.Empty : (string) person.FirstName.Clone();                   this.LastName = person.LastName.CloneSecured();
                                                                                     }
        this.LastName = string.IsNullOrEmpty(person.LastName)
                  ? string.Empty : (string) person.LastName.Clone();                 public object Clone()
    }                                                                                {
                                                                                       return new Person(this);
    public object Clone()                                                            }
    {                                                                            }
      return new Person(this);
    }
}                                         public static class StringExtension
                                           {
                                             public static string CloneSecured(this string original)
                                             {
                                               return string.IsNullOrEmpty(original) ? string.Empty : (string)original.Clone();
                                             }
                                          }
Clean Code Developer – 2nd Iteration
     by Ralf Westphal & Stefan Lieser – http://www.clean-code-developer.de




Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
Separation of Concerns
         (SoC)

 Single Responsibility
       Principle
         (SRP)
The Product




http://www.technicopedia.com/8865.html
Component / Service




          http://www.technicopedia.com/8865.html
Class, Struct, Enum etc.




http://technicbricks.blogspot.com/2009/06/tbs-techpoll-12-results-2009-1st.html
Separation of Concerns (SoC)
     probably by Edsger W. Dijkstra in 1974

• “In computer science,
separation of concerns (SoC) is
the process of separating a
computer program into distinct
features that overlap in
functionality as little as possible.

•A concern is any piece of
interest or focus in a program.
Typically, concerns are
synonymous with features or
behaviors. “
 http://en.wikipedia.org/wiki/Separati
 on_of_Concerns
Single Responsibility Principle (SRP)
      by Robert C Martin


“Every object should have a single responsibility, and that
responsibility should be entirely encapsulated by the class.”
    http://en.wikipedia.org/wiki/Single_responsibility_principle




public class Logger : ILogger
{
  public Logger(ILoggingSink loggingSink)
  {}

     public void Log(string message)
     {}
}
                                                                   http://www.ericalbrecht.com
Source Code Conventions
“Clean Code” –Guidelines *
              by Robert C. Martin

•   use meaningful, pronounceable, searchable Names
•   write code readable top to bottom (Journal Style)
•   prefer Exceptions over returning Error Codes
•   explain yourself in Code
•   avoid redundant, misleading and noise Comments
•   don’t use a Comment when you can use a Method or Variable
•   Avoid commented-out code and Javadocs in NonPublic Code
•   Don’t Return or Pass Null
•   Keep Tests Clean and have only One Assert per Test
•   Classes and Methods should be small
•   Limit the scope of Data and use Copies of Data
•   Builds and Tests should only require 1 Step
     * Chapter extract: Robert C. Martin –” Clean Code”, Parson Education, Inc. 2008
The “Must Read”-Book(s)
 by Robert C Martin


A Handbook of Agile
Software
Craftsmanship

“Even bad code can
function. But if code
isn’t clean, it can bring a
development
organization to its
knees.”
TheKrzysztof Cwalina,Read”-Book(s)
  by
     “Must Brad Abrams
Framework Design
Guidelines

“teaches
developers the
best practices for
designing reusable
libraries for the
Microsoft .NET
Framework.”
Clean Code Developer – 3rd Iteration
     by Ralf Westphal & Stefan Lieser – http://www.clean-code-developer.de




Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
Information Hiding Principle
           (IHP)
Information Hiding Principle (IHP)
         by David Parnas (1972)


“.. information hiding is the principle of
segregation of the design decisions on a
computer program that are most likely to
change, ..”
 http://en.wikipedia.org/wiki/Information_hiding
Liskov Substitution Principle
           (LSP)
Liskov Substitution Principle (LSP)
by Barbara Liskov, Jannette Wing (1994)


“Liskov’s notion of a behavioral subtype
defines a notion of substitutability for
mutable objects”
 http://en.wikipedia.org/wiki/Liskov_substitution_principle
Interfaces / Contracts
• Decouple Usage and Implementation through introduction of a contract
• Allows to replace implementation without changing the consumer

public interface ILogger              public class Logger : ILogger
{                                     {
  void Log(string message);             public Logger(ILoggingSink loggingSink)
}                                       {}

                                          public void Log(string message)
                                          {}
                                      }
Dependency Inversion Principle
           (DIP)
Dependency Inversion Principle (DIP)
  by Robert C. Martin


• “High-level modules should not depend on
  low-level modules. Both should depend on
  abstractions.
• Abstractions should not depend upon details.
  Details should depend upon abstractions.”
  http://en.wikipedia.org/wiki/Dependency_inversion_principle
Clean Code Developer – 4th Iteration
     by Ralf Westphal & Stefan Lieser – http://www.clean-code-developer.de




Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
Open Closed Principle
       (OCP)
Open/Closed Principle (OCP)
by Bertrand Meyer (1988)


An implementation is open for extension
but closed for modification




           http://en.wikipedia.org/wiki/Open/closed_principle
Law of Demeter
     (LoD)
Law of Demeter (LoD)
           Northeastern University (1987)

“
• Each unit should have only limited knowledge
  about other units: only units “closely” related
  to the current unit.
• Each unit should only talk to its friends;
  don’t talk to strangers
• Only talk to your immediate friends.”
  http://en.wikipedia.org/wiki/Law_Of_Demeter
S               Single Responsibility Principle

   O               Open/Closed Principle

   L               Liskov Substitution Principle

   I               Interface Segregation Principle

   D               Dependency Inversion Principle

Robert C Martin:   http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
Clean Code Developer – 5th Iteration
     by Ralf Westphal & Stefan Lieser – http://www.clean-code-developer.de




Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
Component-Oriented
   Programming
       (CoP)
Different Ways of doing something similar




http://www.ericalbrecht.com




                                                            http://www.julianaheng.com/transformers-rotf-bumblebee-
                                                            and-sam-action-figures/




                              http://www.ericalbrecht.com
Why Reusable Components rock




http://www.ericalbrecht.com/technic/8020/8020all.jpg
Inversion of Control
        (IoC)
Inversion of Control (IoC)
by Martin Fowler 1994




      Logger logger = new Logger();
Inversion of Control (IoC)
by Martin Fowler 1994




      Logger logger = new Logger();
Inversion of Control –

Constructor Injection
 http://www.martinfowler.com/articles/injection.html


  public class ContactManager : IContactManager
  {
    public ContactManager(ILogger logger,
                            IContactPersistence contactPersistence)
    {
      this.logger = logger;
      if (logger == null)
      {
         throw new ArgumentNullException("logger");
      }

          …
      }
  }
Dependency Injection Container & more
• Typically support all types of Inversion of Control mechanisms
   • Constructor Injection
   • Property (Setter) Injection
   • Interface Injection
   • Service Locator

•.NET based DI-Container
   • Unity
   • Castle Windsor
   • StructureMap
                                   Related Technology:
   • Spring.NET                    • Managed Extensibility Framework (MEF)
   • Autofac                       • Windows Communication Foundation (WCF)
   • Puzzle.Nfactory
   • Ninject
   • PicoContainer.NET
   • and more
The “Must Read”-Book(s)
 by Mark Seemann


Dependency
Injection is a set of
software design
principles and
patterns that
enable us to
develop loosely
coupled code.


     http://www.manning.com/seemann/
Summary Clean Code
Maintainability is achieved through:
• Readability (Coding Guidelines)
• Simplification and Specialization
  (KISS, SoC, SRP, OCP, )
• Decoupling (LSP, DIP, IHP, Contracts,
  LoD, CoP, IoC or SOA)
• Avoiding Code Bloat (DRY, YAGNI)
• Quality through Testability
  (all of them!)
Q&A
                                         Downloads,
                                         Feedback & Comments:
                                                  theo@csharp-lighthouse.com
                                                   www.csharp-lightouse.com
                                                   www.speakerrate.com/theoj
Graphic by Nathan Sawaya courtesy of brickartist.com
http://clean-code-developer.com
                                          References…
http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
http://www.manning.com/seemann/
http://en.wikipedia.org/wiki/Keep_it_simple_stupid
http://picocontainer.org/patterns.html
http://en.wikipedia.org/wiki/Separation_of_concerns
http://en.wikipedia.org/wiki/Single_responsibility_principle
http://en.wikipedia.org/wiki/Information_hiding
http://en.wikipedia.org/wiki/Liskov_substitution_principle
http://en.wikipedia.org/wiki/Dependency_inversion_principle
http://en.wikipedia.org/wiki/Open/closed_principle
http://en.wikipedia.org/wiki/Law_Of_Demeter
http://en.wikipedia.org/wiki/Don't_repeat_yourself
http://en.wikipedia.org/wiki/You_ain't_gonna_need_it
http://en.wikipedia.org/wiki/Component-oriented_programming
http://en.wikipedia.org/wiki/Service-oriented_architecture
http://www.martinfowler.com/articles/injection.html
http://www.codeproject.com/KB/aspnet/IOCDI.aspx
http://msdn.microsoft.com/en-us/magazine/cc163739.aspx
http://msdn.microsoft.com/en-us/library/ff650320.aspx
http://msdn.microsoft.com/en-us/library/aa973811.aspx
http://msdn.microsoft.com/en-us/library/ff647976.aspx
http://msdn.microsoft.com/en-us/library/cc707845.aspx
http://msdn.microsoft.com/en-us/library/bb833022.aspx
http://unity.codeplex.com/
http://www.idesign.net/idesign/DesktopDefault.aspx?tabindex=5&tabid=11
… more References
Resharper
http://www.jetbrains.com/resharper/

FxCop / Code Analysis
http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx
http://blogs.msdn.com/b/codeanalysis/
http://www.binarycoder.net/fxcop/index.html

Code Contracts
http://msdn.microsoft.com/en-us/devlabs/dd491992
http://research.microsoft.com/en-us/projects/contracts/

Pex & Mole
http://research.microsoft.com/en-us/projects/pex/

StyleCop
http://stylecop.codeplex.com/

Ghostdoc
http://submain.com/products/ghostdoc.aspx

Spellchecker
http://visualstudiogallery.msdn.microsoft.com/
7c8341f1-ebac-40c8-92c2-476db8d523ce//
                                                               Lego (trademarked in capitals as LEGO)
Please fill out the
online feedback, and…


… thanks for you attention!

        And visit and support the
             Bay.net User Group
                    http://baynetug.org

Contenu connexe

Tendances

Java OOP Programming language (Part 8) - Java Database JDBC
Java OOP Programming language (Part 8) - Java Database JDBCJava OOP Programming language (Part 8) - Java Database JDBC
Java OOP Programming language (Part 8) - Java Database JDBCOUM SAOKOSAL
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQLPeter Eisentraut
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners Varun Raj
 
7 rules of simple and maintainable code
7 rules of simple and maintainable code7 rules of simple and maintainable code
7 rules of simple and maintainable codeGeshan Manandhar
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NETDror Helper
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#Aditya Kumar Rajan
 
Coding Best Practices
Coding Best PracticesCoding Best Practices
Coding Best Practicesmh_azad
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOPDzmitry Naskou
 
Clean Code II - Dependency Injection
Clean Code II - Dependency InjectionClean Code II - Dependency Injection
Clean Code II - Dependency InjectionTheo Jungeblut
 
Operator overloading and type conversion in cpp
Operator overloading and type conversion in cppOperator overloading and type conversion in cpp
Operator overloading and type conversion in cpprajshreemuthiah
 
Advanced front-end automation with npm scripts
Advanced front-end automation with npm scriptsAdvanced front-end automation with npm scripts
Advanced front-end automation with npm scriptsk88hudson
 

Tendances (20)

Java OOP Programming language (Part 8) - Java Database JDBC
Java OOP Programming language (Part 8) - Java Database JDBCJava OOP Programming language (Part 8) - Java Database JDBC
Java OOP Programming language (Part 8) - Java Database JDBC
 
Clean code
Clean codeClean code
Clean code
 
J2ee
J2eeJ2ee
J2ee
 
Clean Code
Clean CodeClean Code
Clean Code
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
Clean code
Clean codeClean code
Clean code
 
SOLID PRINCIPLES
SOLID PRINCIPLESSOLID PRINCIPLES
SOLID PRINCIPLES
 
React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - Introduction
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
7 rules of simple and maintainable code
7 rules of simple and maintainable code7 rules of simple and maintainable code
7 rules of simple and maintainable code
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NET
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#
 
Coding Best Practices
Coding Best PracticesCoding Best Practices
Coding Best Practices
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOP
 
Clean Code II - Dependency Injection
Clean Code II - Dependency InjectionClean Code II - Dependency Injection
Clean Code II - Dependency Injection
 
Operator overloading and type conversion in cpp
Operator overloading and type conversion in cppOperator overloading and type conversion in cpp
Operator overloading and type conversion in cpp
 
Java Spring Framework
Java Spring FrameworkJava Spring Framework
Java Spring Framework
 
Advanced front-end automation with npm scripts
Advanced front-end automation with npm scriptsAdvanced front-end automation with npm scripts
Advanced front-end automation with npm scripts
 
NestJS
NestJSNestJS
NestJS
 

En vedette

Clean Code Part I - Design Patterns at SoCal Code Camp
Clean Code Part I - Design Patterns at SoCal Code CampClean Code Part I - Design Patterns at SoCal Code Camp
Clean Code Part I - Design Patterns at SoCal Code CampTheo Jungeblut
 
Accidentally Manager – A Survival Guide for First-Time Engineering Managers
Accidentally Manager – A Survival Guide for First-Time Engineering ManagersAccidentally Manager – A Survival Guide for First-Time Engineering Managers
Accidentally Manager – A Survival Guide for First-Time Engineering ManagersTheo Jungeblut
 
Clean code and the clean coders
Clean code and the clean codersClean code and the clean coders
Clean code and the clean codersluisartola
 
Clean code and Code Smells
Clean code and Code SmellsClean code and Code Smells
Clean code and Code SmellsMario Sangiorgio
 
Clean Code: Stop wasting my time
Clean Code: Stop wasting my timeClean Code: Stop wasting my time
Clean Code: Stop wasting my timeEdorian
 
Clean Code summary
Clean Code summaryClean Code summary
Clean Code summaryJan de Vries
 
Stop wasting-time-by-applying-clean-code-principles
Stop wasting-time-by-applying-clean-code-principlesStop wasting-time-by-applying-clean-code-principles
Stop wasting-time-by-applying-clean-code-principlesEdorian
 

En vedette (12)

Clean code
Clean codeClean code
Clean code
 
Clean Code 2
Clean Code 2Clean Code 2
Clean Code 2
 
Clean Code Part I - Design Patterns at SoCal Code Camp
Clean Code Part I - Design Patterns at SoCal Code CampClean Code Part I - Design Patterns at SoCal Code Camp
Clean Code Part I - Design Patterns at SoCal Code Camp
 
Accidentally Manager – A Survival Guide for First-Time Engineering Managers
Accidentally Manager – A Survival Guide for First-Time Engineering ManagersAccidentally Manager – A Survival Guide for First-Time Engineering Managers
Accidentally Manager – A Survival Guide for First-Time Engineering Managers
 
Clean code and the clean coders
Clean code and the clean codersClean code and the clean coders
Clean code and the clean coders
 
Clean code and Code Smells
Clean code and Code SmellsClean code and Code Smells
Clean code and Code Smells
 
Clean Code: Stop wasting my time
Clean Code: Stop wasting my timeClean Code: Stop wasting my time
Clean Code: Stop wasting my time
 
Clean Code summary
Clean Code summaryClean Code summary
Clean Code summary
 
Stop wasting-time-by-applying-clean-code-principles
Stop wasting-time-by-applying-clean-code-principlesStop wasting-time-by-applying-clean-code-principles
Stop wasting-time-by-applying-clean-code-principles
 
Clean Code
Clean CodeClean Code
Clean Code
 
Clean coding-practices
Clean coding-practicesClean coding-practices
Clean coding-practices
 
Make a better with clean code
Make a better with clean codeMake a better with clean code
Make a better with clean code
 

Similaire à Clean Code at Silicon Valley Code Camp 2011 (02/17/2012)

Clean Code for East Bay .NET User Group
Clean Code for East Bay .NET User GroupClean Code for East Bay .NET User Group
Clean Code for East Bay .NET User GroupTheo Jungeblut
 
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...Contract First Development with Microsoft Code Contracts and Microsoft Pex at...
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...Theo Jungeblut
 
Clean Code - Design Patterns and Best Practices for Bay.NET SF User Group (01...
Clean Code - Design Patterns and Best Practices for Bay.NET SF User Group (01...Clean Code - Design Patterns and Best Practices for Bay.NET SF User Group (01...
Clean Code - Design Patterns and Best Practices for Bay.NET SF User Group (01...Theo Jungeblut
 
Lego For Engineers - Dependency Injection for LIDNUG (2011-06-03)
Lego For Engineers - Dependency Injection for LIDNUG (2011-06-03)Lego For Engineers - Dependency Injection for LIDNUG (2011-06-03)
Lego For Engineers - Dependency Injection for LIDNUG (2011-06-03)Theo Jungeblut
 
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...Theo Jungeblut
 
Clean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code CampClean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code CampTheo Jungeblut
 
Practical Chaos Engineering
Practical Chaos EngineeringPractical Chaos Engineering
Practical Chaos EngineeringSIGHUP
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011YoungSu Son
 
Atlassian Groovy Plugins
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy PluginsPaul King
 
Clean Code Part i - Design Patterns and Best Practices -
Clean Code Part i - Design Patterns and Best Practices -Clean Code Part i - Design Patterns and Best Practices -
Clean Code Part i - Design Patterns and Best Practices -Theo Jungeblut
 
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Tudor Dragan
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...Edge AI and Vision Alliance
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorialsakreyi
 
Writing code that writes code - Nguyen Luong
Writing code that writes code - Nguyen LuongWriting code that writes code - Nguyen Luong
Writing code that writes code - Nguyen LuongVu Huy
 
TechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
TechkTalk #12 Grokking: Writing code that writes code – Nguyen LuongTechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
TechkTalk #12 Grokking: Writing code that writes code – Nguyen LuongGrokking VN
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworksMD Sayem Ahmed
 
Microservices Chaos Testing at Jet
Microservices Chaos Testing at JetMicroservices Chaos Testing at Jet
Microservices Chaos Testing at JetC4Media
 
Gae icc fall2011
Gae icc fall2011Gae icc fall2011
Gae icc fall2011Juan Gomez
 

Similaire à Clean Code at Silicon Valley Code Camp 2011 (02/17/2012) (20)

Clean Code for East Bay .NET User Group
Clean Code for East Bay .NET User GroupClean Code for East Bay .NET User Group
Clean Code for East Bay .NET User Group
 
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...Contract First Development with Microsoft Code Contracts and Microsoft Pex at...
Contract First Development with Microsoft Code Contracts and Microsoft Pex at...
 
Clean Code - Design Patterns and Best Practices for Bay.NET SF User Group (01...
Clean Code - Design Patterns and Best Practices for Bay.NET SF User Group (01...Clean Code - Design Patterns and Best Practices for Bay.NET SF User Group (01...
Clean Code - Design Patterns and Best Practices for Bay.NET SF User Group (01...
 
Lego For Engineers - Dependency Injection for LIDNUG (2011-06-03)
Lego For Engineers - Dependency Injection for LIDNUG (2011-06-03)Lego For Engineers - Dependency Injection for LIDNUG (2011-06-03)
Lego For Engineers - Dependency Injection for LIDNUG (2011-06-03)
 
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
 
Clean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code CampClean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
 
Effective Object Oriented Design in Cpp
Effective Object Oriented Design in CppEffective Object Oriented Design in Cpp
Effective Object Oriented Design in Cpp
 
Practical Chaos Engineering
Practical Chaos EngineeringPractical Chaos Engineering
Practical Chaos Engineering
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Atlassian Groovy Plugins
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy Plugins
 
Clean Code Part i - Design Patterns and Best Practices -
Clean Code Part i - Design Patterns and Best Practices -Clean Code Part i - Design Patterns and Best Practices -
Clean Code Part i - Design Patterns and Best Practices -
 
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
Writing code that writes code - Nguyen Luong
Writing code that writes code - Nguyen LuongWriting code that writes code - Nguyen Luong
Writing code that writes code - Nguyen Luong
 
TechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
TechkTalk #12 Grokking: Writing code that writes code – Nguyen LuongTechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
TechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworks
 
Microservices Chaos Testing at Jet
Microservices Chaos Testing at JetMicroservices Chaos Testing at Jet
Microservices Chaos Testing at Jet
 
Gae icc fall2011
Gae icc fall2011Gae icc fall2011
Gae icc fall2011
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 

Plus de Theo Jungeblut

Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...
Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...
Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...Theo Jungeblut
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Theo Jungeblut
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Theo Jungeblut
 
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...Theo Jungeblut
 
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)Theo Jungeblut
 
Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group Theo Jungeblut
 
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group OsnabrueckCut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group OsnabrueckTheo Jungeblut
 
Cut your Dependencies - Dependency Injection at Silicon Valley Code Camp
Cut your Dependencies - Dependency Injection at Silicon Valley Code CampCut your Dependencies - Dependency Injection at Silicon Valley Code Camp
Cut your Dependencies - Dependency Injection at Silicon Valley Code CampTheo Jungeblut
 
Clean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code CampClean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code CampTheo Jungeblut
 
Clean Code Part II - Dependency Injection at SoCal Code Camp
Clean Code Part II - Dependency Injection at SoCal Code CampClean Code Part II - Dependency Injection at SoCal Code Camp
Clean Code Part II - Dependency Injection at SoCal Code CampTheo Jungeblut
 
Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)
Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)
Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)Theo Jungeblut
 

Plus de Theo Jungeblut (11)

Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...
Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...
Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
 
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
 
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)
 
Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group
 
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group OsnabrueckCut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
 
Cut your Dependencies - Dependency Injection at Silicon Valley Code Camp
Cut your Dependencies - Dependency Injection at Silicon Valley Code CampCut your Dependencies - Dependency Injection at Silicon Valley Code Camp
Cut your Dependencies - Dependency Injection at Silicon Valley Code Camp
 
Clean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code CampClean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code Camp
 
Clean Code Part II - Dependency Injection at SoCal Code Camp
Clean Code Part II - Dependency Injection at SoCal Code CampClean Code Part II - Dependency Injection at SoCal Code Camp
Clean Code Part II - Dependency Injection at SoCal Code Camp
 
Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)
Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)
Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)
 

Dernier

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 

Dernier (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Clean Code at Silicon Valley Code Camp 2011 (02/17/2012)

  • 1. Silicon Valley Code Camp Clean Code Why Clean Code matters Foothill College, October 9nd 2011
  • 2. Theo Jungeblut • Senior Software Developer at Omnicell Inc. in Mountain View • Has been designing and implementing .NET based applications , components and frameworks for more than 8 years • Previously worked in factory automation with focus on component based software and framework development for 3 ½ years theo@csharp-lighthouse.com • Degree in Software Engineering and Network Communications www.csharp-lighthouse.com
  • 3. Overview • Why Clean Code • Tools • Resharper • FxCop, StyleCop & StyleCop plugin for Resharper • GhostDoc & Spell Checker • Code Contracts, Pex & Moles • Clean Code Developer Initiative • Principles and Practices • Code Comparison • Q&A
  • 4. Does writing Clean Code make us more efficient?
  • 5.
  • 7. Clean Code is maintainable Source code must be: • readable & well structured • extensible • testable
  • 8. Software Engineering vs. Craftsmanship
  • 9. The “Must Read”-Book(s) by Robert C Martin A Handbook of Agile Software Craftsmanship “Even bad code can function. But if code isn’t clean, it can bring a development organization to its knees.”
  • 10. Code Maintainability * Principles Patterns Containers Why? How? What? Extensibility Clean Code Tool reuse * from: Mark Seemann’s “Dependency Injection in .NET” presentation Bay.NET 05/2011
  • 11. .NET Tools and their Impact Tool name Positive Impact Negative Impact Resharper compiling ++++ VS responsiveness -- FxCop code quality ++ compiling time - StyleCop code consistency +++ compiling time - StyleCop plugin compiling time +++ VS responsiveness -- for Resharper Ghost Doc automated docs potentially worse doc Spell Checker fewer spelling errors ++ performance -- Code Contracts testability, quality ++ compiling time -- Pex & Moles automated test ++ compiling time --
  • 12. Resharper “The single most impacting development addition to Visual Studio” Features: – Code Analysis – Quick Fixes – Code Templates – Code Generation – Code Cleanup – Many, many more… http://www.jetbrains.com/resharper/
  • 13. FxCop / Static Code Analysis Code Analysis: – Correctness – Library design – Internationalization and localization – Naming conventions – Performance – Security http://msdn.microsoft.com/en-us/library/3z0aeatx.aspx
  • 14. Style Cop with R# Integration Code Consistency & Readability: – Automated check of C# coding standard – Enforceable at check-in with TFS check-in Policy – Full Integration in Resharper with Style Cop plugin: – Code Analysis – Quick Fixes – Code Cleanup
  • 15. Ghost Doc • Save keystrokes and time • Simplify documenting your code • Benefit of the base class documentation http://submain.com/products/ghostdoc.aspx
  • 16. Spell Checker • Spelll chicking for literals and comments in VS http://visualstudiogallery.msdn.microsoft.com/7c8341f1-ebac-40c8-92c2-476db8d523ce/
  • 17. Design-by-Contract programming • Improved testability • Static verification • API documentation integration with Sandcastle http://msdn.microsoft.com/en-us/devlabs/dd491992
  • 18. Microsoft Pex & Moles • Pex automatically generates test suites with high code coverage. • Moles allows to replace any .NET method with a delegate. http://research.microsoft.com/en-us/projects/pex/
  • 19. Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
  • 20. Clean Code Developer – 1st Iteration by Ralf Westphal & Stefan Lieser – http://www.clean-code-developer.de Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
  • 21. Keep it simple, stupid (KISS)
  • 22. KISS-Principle – “Keep It Simple Stupid” by Kelly Johnson http://blogs.smarter.com/blogs/Lego%20Brick.jpg
  • 23. The Power of Simplicity Graphic by Nathan Sawaya courtesy of brickartist.com Graphic by Nathan Sawaya courtesy of brickartist.com http://www.geekalerts.com/lego-iphone/
  • 24. Graphic by Nathan Sawaya courtesy of brickartist.com
  • 26. Don’t repeat yourself (DRY) by Andy Hunt and Dave Thomas in their book “The Pragmatic Programmer” // Code Copy and Paste Method // DRY Method public Class Person public Class Person { { public string FirstName { get; set;} public string FirstName { get; set;} public string LastName { get; set;} public string LastName { get; set;} public Person(Person person) public Person(Person person) { { this.FirstName = string.IsNullOrEmpty(person.FirstName) this.FirstName = person.FirstName.CloneSecured(); ? string.Empty : (string) person.FirstName.Clone(); this.LastName = person.LastName.CloneSecured(); } this.LastName = string.IsNullOrEmpty(person.LastName) ? string.Empty : (string) person.LastName.Clone(); public object Clone() } { return new Person(this); public object Clone() } { } return new Person(this); } } public static class StringExtension { public static string CloneSecured(this string original) { return string.IsNullOrEmpty(original) ? string.Empty : (string)original.Clone(); } }
  • 27. Clean Code Developer – 2nd Iteration by Ralf Westphal & Stefan Lieser – http://www.clean-code-developer.de Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
  • 28. Separation of Concerns (SoC) Single Responsibility Principle (SRP)
  • 30. Component / Service http://www.technicopedia.com/8865.html
  • 31. Class, Struct, Enum etc. http://technicbricks.blogspot.com/2009/06/tbs-techpoll-12-results-2009-1st.html
  • 32. Separation of Concerns (SoC) probably by Edsger W. Dijkstra in 1974 • “In computer science, separation of concerns (SoC) is the process of separating a computer program into distinct features that overlap in functionality as little as possible. •A concern is any piece of interest or focus in a program. Typically, concerns are synonymous with features or behaviors. “ http://en.wikipedia.org/wiki/Separati on_of_Concerns
  • 33. Single Responsibility Principle (SRP) by Robert C Martin “Every object should have a single responsibility, and that responsibility should be entirely encapsulated by the class.” http://en.wikipedia.org/wiki/Single_responsibility_principle public class Logger : ILogger { public Logger(ILoggingSink loggingSink) {} public void Log(string message) {} } http://www.ericalbrecht.com
  • 35. “Clean Code” –Guidelines * by Robert C. Martin • use meaningful, pronounceable, searchable Names • write code readable top to bottom (Journal Style) • prefer Exceptions over returning Error Codes • explain yourself in Code • avoid redundant, misleading and noise Comments • don’t use a Comment when you can use a Method or Variable • Avoid commented-out code and Javadocs in NonPublic Code • Don’t Return or Pass Null • Keep Tests Clean and have only One Assert per Test • Classes and Methods should be small • Limit the scope of Data and use Copies of Data • Builds and Tests should only require 1 Step * Chapter extract: Robert C. Martin –” Clean Code”, Parson Education, Inc. 2008
  • 36. The “Must Read”-Book(s) by Robert C Martin A Handbook of Agile Software Craftsmanship “Even bad code can function. But if code isn’t clean, it can bring a development organization to its knees.”
  • 37. TheKrzysztof Cwalina,Read”-Book(s) by “Must Brad Abrams Framework Design Guidelines “teaches developers the best practices for designing reusable libraries for the Microsoft .NET Framework.”
  • 38. Clean Code Developer – 3rd Iteration by Ralf Westphal & Stefan Lieser – http://www.clean-code-developer.de Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
  • 40. Information Hiding Principle (IHP) by David Parnas (1972) “.. information hiding is the principle of segregation of the design decisions on a computer program that are most likely to change, ..” http://en.wikipedia.org/wiki/Information_hiding
  • 42. Liskov Substitution Principle (LSP) by Barbara Liskov, Jannette Wing (1994) “Liskov’s notion of a behavioral subtype defines a notion of substitutability for mutable objects” http://en.wikipedia.org/wiki/Liskov_substitution_principle
  • 43. Interfaces / Contracts • Decouple Usage and Implementation through introduction of a contract • Allows to replace implementation without changing the consumer public interface ILogger public class Logger : ILogger { { void Log(string message); public Logger(ILoggingSink loggingSink) } {} public void Log(string message) {} }
  • 45. Dependency Inversion Principle (DIP) by Robert C. Martin • “High-level modules should not depend on low-level modules. Both should depend on abstractions. • Abstractions should not depend upon details. Details should depend upon abstractions.” http://en.wikipedia.org/wiki/Dependency_inversion_principle
  • 46. Clean Code Developer – 4th Iteration by Ralf Westphal & Stefan Lieser – http://www.clean-code-developer.de Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
  • 48. Open/Closed Principle (OCP) by Bertrand Meyer (1988) An implementation is open for extension but closed for modification http://en.wikipedia.org/wiki/Open/closed_principle
  • 49. Law of Demeter (LoD)
  • 50. Law of Demeter (LoD) Northeastern University (1987) “ • Each unit should have only limited knowledge about other units: only units “closely” related to the current unit. • Each unit should only talk to its friends; don’t talk to strangers • Only talk to your immediate friends.” http://en.wikipedia.org/wiki/Law_Of_Demeter
  • 51. S Single Responsibility Principle O Open/Closed Principle L Liskov Substitution Principle I Interface Segregation Principle D Dependency Inversion Principle Robert C Martin: http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
  • 52. Clean Code Developer – 5th Iteration by Ralf Westphal & Stefan Lieser – http://www.clean-code-developer.de Graphic by Michael Hönnig http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/
  • 53. Component-Oriented Programming (CoP)
  • 54. Different Ways of doing something similar http://www.ericalbrecht.com http://www.julianaheng.com/transformers-rotf-bumblebee- and-sam-action-figures/ http://www.ericalbrecht.com
  • 55. Why Reusable Components rock http://www.ericalbrecht.com/technic/8020/8020all.jpg
  • 57. Inversion of Control (IoC) by Martin Fowler 1994 Logger logger = new Logger();
  • 58. Inversion of Control (IoC) by Martin Fowler 1994 Logger logger = new Logger();
  • 59. Inversion of Control – Constructor Injection http://www.martinfowler.com/articles/injection.html public class ContactManager : IContactManager { public ContactManager(ILogger logger, IContactPersistence contactPersistence) { this.logger = logger; if (logger == null) { throw new ArgumentNullException("logger"); } … } }
  • 60. Dependency Injection Container & more • Typically support all types of Inversion of Control mechanisms • Constructor Injection • Property (Setter) Injection • Interface Injection • Service Locator •.NET based DI-Container • Unity • Castle Windsor • StructureMap Related Technology: • Spring.NET • Managed Extensibility Framework (MEF) • Autofac • Windows Communication Foundation (WCF) • Puzzle.Nfactory • Ninject • PicoContainer.NET • and more
  • 61. The “Must Read”-Book(s) by Mark Seemann Dependency Injection is a set of software design principles and patterns that enable us to develop loosely coupled code. http://www.manning.com/seemann/
  • 62. Summary Clean Code Maintainability is achieved through: • Readability (Coding Guidelines) • Simplification and Specialization (KISS, SoC, SRP, OCP, ) • Decoupling (LSP, DIP, IHP, Contracts, LoD, CoP, IoC or SOA) • Avoiding Code Bloat (DRY, YAGNI) • Quality through Testability (all of them!)
  • 63. Q&A Downloads, Feedback & Comments: theo@csharp-lighthouse.com www.csharp-lightouse.com www.speakerrate.com/theoj Graphic by Nathan Sawaya courtesy of brickartist.com
  • 64. http://clean-code-developer.com References… http://michael.hoennig.de/2009/08/08/clean-code-developer-ccd/ http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod http://www.manning.com/seemann/ http://en.wikipedia.org/wiki/Keep_it_simple_stupid http://picocontainer.org/patterns.html http://en.wikipedia.org/wiki/Separation_of_concerns http://en.wikipedia.org/wiki/Single_responsibility_principle http://en.wikipedia.org/wiki/Information_hiding http://en.wikipedia.org/wiki/Liskov_substitution_principle http://en.wikipedia.org/wiki/Dependency_inversion_principle http://en.wikipedia.org/wiki/Open/closed_principle http://en.wikipedia.org/wiki/Law_Of_Demeter http://en.wikipedia.org/wiki/Don't_repeat_yourself http://en.wikipedia.org/wiki/You_ain't_gonna_need_it http://en.wikipedia.org/wiki/Component-oriented_programming http://en.wikipedia.org/wiki/Service-oriented_architecture http://www.martinfowler.com/articles/injection.html http://www.codeproject.com/KB/aspnet/IOCDI.aspx http://msdn.microsoft.com/en-us/magazine/cc163739.aspx http://msdn.microsoft.com/en-us/library/ff650320.aspx http://msdn.microsoft.com/en-us/library/aa973811.aspx http://msdn.microsoft.com/en-us/library/ff647976.aspx http://msdn.microsoft.com/en-us/library/cc707845.aspx http://msdn.microsoft.com/en-us/library/bb833022.aspx http://unity.codeplex.com/ http://www.idesign.net/idesign/DesktopDefault.aspx?tabindex=5&tabid=11
  • 65. … more References Resharper http://www.jetbrains.com/resharper/ FxCop / Code Analysis http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx http://blogs.msdn.com/b/codeanalysis/ http://www.binarycoder.net/fxcop/index.html Code Contracts http://msdn.microsoft.com/en-us/devlabs/dd491992 http://research.microsoft.com/en-us/projects/contracts/ Pex & Mole http://research.microsoft.com/en-us/projects/pex/ StyleCop http://stylecop.codeplex.com/ Ghostdoc http://submain.com/products/ghostdoc.aspx Spellchecker http://visualstudiogallery.msdn.microsoft.com/ 7c8341f1-ebac-40c8-92c2-476db8d523ce// Lego (trademarked in capitals as LEGO)
  • 66. Please fill out the online feedback, and… … thanks for you attention! And visit and support the Bay.net User Group http://baynetug.org