A NTI -P ATTERNS
Patterns are ever ywhere
There are GOOD patterns
There are BAD patterns
Bad Patterns
Bad patterns
seriously harm you and others
          around you
I see BAD
       PATTERNS!




COLE
Programming
  Methodological
  Organizational
       Design
A NTI -P ATTERNS
   AntiPatterns
    AntiPatterns
Programming
AntiPatterns


          Methodological
          Organizational
               Design
        A NTI -P ATTERNS
           AntiPatterns
           AntiPatterns
Programming         Methodological
AntiPatterns         AntiPatterns


          Organizational
               Design
        A NTI -P ATTERNS
           AntiPatterns
           AntiPatterns
Programming          Methodological
AntiPatterns          AntiPatterns


           Organizational
         A NTI -P ATTERNS
            AntiPatterns



  Design
AntiPatterns
Programming          Methodological
AntiPatterns          AntiPatterns



         A NTI -P ATTERNS


  Design             Organizational
AntiPatterns          AntiPatterns
Organizational
      Design
    AntiPatterns
Methodological
    AntiPatterns
Programming
 AntiPatterns
AntiPatterns
BLIND FAITH


  Introducing
  unnecessary
complexity into a
    solution
                     Lack of checking of
                    (a) the correctness of
                      a bug fix or (b) the
                    result of a subroutine


 ACCIDENTAL
 COMPLEXITY
CARGO CULT
PROGRAMMING

                       Incomprehensible
                           structure ,
                       especially because
                       of misuse of code
                           structures
  Using patterns and
   methods without
  understanding why

                          SPAGHETTI
                            CODE
SOFT CODE


    Embedding
assumptions about
the environment of
  a system in its      Storing business
                     logic in configuration
                        files rather than
                          source code


  HARD CODE
LAVA FLOW



                        Retaining a part of
Retaining undesirable    a system that no
 (redundant or low-     longer has any use
quality) code because
  removing it is too
   expensive or has
    unpredictable


                              BOAT
                             ANCHOR
MAGIC
                 STRINGS

  Including
unexplained
numbers in
 algorithms
                Including literal
              strings in code, for
               comparisons, as
                event types etc.


 MAGIC
NUMBERS
SINGLE FUNCTION
   EXIT POINT


    	 public Foo merge (Foo a, Foo b) {
	       Foo result;
	       if (a != null) {
	         if (b != null) {
	           // complicated merge code goes here.
	         } else {
	           result = a;
	         }
	       } else {
	         result = b;
	       }
	       return result;
	     }
GUARD CLAUSE


    	 public Foo merge (Foo a, Foo b) {
	       Foo result;
	       if (a != null) {
	         if (b != null) {
	           // complicated merge code goes here.   	   public Foo merge (Foo a, Foo b) {
	         } else {                                 	     if (a == null) return b;
	           result = a;                            	     if (b == null) return a;
	         }                                        	       // complicated merge code goes here.
	       } else {                                   	     }
	         result = b;
	       }
	       return result;
	     }
ARROW
ANTI-PATTERN

if
     if
       if
          if
        do something
      endif
    endif
  endif
endif
int foo(void)
	     {
	   	     char *p = NULL;
	   	     char *q = NULL;
                                   	   int     foo(void)
	   	     int ret = SUCCESS;
                                   	     {
                                   	   	       char *p = malloc(SIZEOF_P);
	   	    p = malloc(SIZEOF_P);
                                   	   	       char *q = malloc(SIZEOF_Q);
	   	    if(p)
                                   	   	       int ret = p && q ? SUCCESS : FAIL;
	   	    {
	   	      q = malloc(SIZEOF_Q);
                                   	   	       if (ret == SUCCESS)
	   	      if(q)
                                   	   	       {
	   	      {
                                   	   	       /* do something */
	   	    	    /* do something */
                                   	   	       }
	   	    	     free(q);
                                   	   	       free(p);
	   	      }
                                   	   	       free(q);
	   	      else
	   	    	    ret = FAIL;
                                   	   	       return ret;
                                   	       }
	   	        free(p);
	   	    }
	   	    else
	   	      ret = FAIL;

	   	    return ret;
	    }
LOOP-SWITCH
                                    SEQUENCE


// parse a key, a value, then three parameters
String key = null;
String value = null;
List<String> params = new LinkedList<String>();   // parse a key and value
                                                  String key = stream.parse();
for (int i = 0; i < 5; i++) {                     String value = stream.parse();
  switch (i) {
      case 0:                                     // parse 3 parameters
          key = stream.parse();                   List<String> params =
          break;                                                  new LinkedList<String>();
      case 1:
          value = stream.parse();                 for (int i = 0; i < 3; i++) {
          break;                                    params.add(stream.parse());
      default:                                    }
          params.add(stream.parse());
          break;
  }
}
Organizational
      Design
    AntiPatterns
Methodological
    AntiPatterns
Programming
 AntiPatterns
AntiPatterns
Organizational
      Design
    AntiPatterns
Methodological
   AntiPatterns
 AntiPatterns
COPY AND PASTE
           PROGRAMMING

TESTER DRIVEN
DEVELOPMENT

           SOMEONE ELSE’S
              EXAMPLE

 PROGRAMMING BY
   PERMUTATION
Organizational
      Design
    AntiPatterns
Methodological
   AntiPatterns
 AntiPatterns
Organizational
  Design
 AntiPatterns
AntiPatterns
CIRCULAR
  DEPENDENCY

GOD OBJECT

             SEQUENTIAL
              COUPLING

      BASE BEAN
ABSTRACTION
  INVERSION


     INNER-PLATFORM
         EFFECT

N-FRAME

   RACE HAZARD
ARCHITECTURE BY
  IMPLICATION
Organizational
  Design
 AntiPatterns
AntiPatterns
Organizational
 AntiPatterns
DESIGN BY
COMMITTEE
ABSTRACTIONIST VS.
            IMPLEMENTATIONIST




“Experts report that only 1 in 5 software developers is able to define good abstractions”
The point isn't as much to say
 "don't do this" as it is to say
   "you probably don't even
realize that you're doing this,
     but it doesn't work..”
WE’VE SEEN

26    ANTI-PATTERNS


 4
OF   DIFFERENT TYPES
PROJECT MANAGEMENT ANTI-PATTERNS


ANALYSIS ANTI-PATTERNS


CONFIGURATION MANAGEMENT ANTI-PATTERNS


SOCIAL ANTI-PATTERNS
http://sourcemaking.com/antipatterns/


http://www.c2.com/cgi/wiki?AntiPatterns


http://en.wikipedia.org/wiki/Anti-pattern

Anti Patterns

  • 1.
    A NTI -PATTERNS
  • 2.
  • 3.
  • 4.
    There are BADpatterns
  • 5.
  • 6.
    Bad patterns seriously harmyou and others around you
  • 7.
    I see BAD PATTERNS! COLE
  • 8.
    Programming Methodological Organizational Design A NTI -P ATTERNS AntiPatterns AntiPatterns
  • 9.
    Programming AntiPatterns Methodological Organizational Design A NTI -P ATTERNS AntiPatterns AntiPatterns
  • 10.
    Programming Methodological AntiPatterns AntiPatterns Organizational Design A NTI -P ATTERNS AntiPatterns AntiPatterns
  • 11.
    Programming Methodological AntiPatterns AntiPatterns Organizational A NTI -P ATTERNS AntiPatterns Design AntiPatterns
  • 12.
    Programming Methodological AntiPatterns AntiPatterns A NTI -P ATTERNS Design Organizational AntiPatterns AntiPatterns
  • 13.
    Organizational Design AntiPatterns Methodological AntiPatterns Programming AntiPatterns AntiPatterns
  • 14.
    BLIND FAITH Introducing unnecessary complexity into a solution Lack of checking of (a) the correctness of a bug fix or (b) the result of a subroutine ACCIDENTAL COMPLEXITY
  • 15.
    CARGO CULT PROGRAMMING Incomprehensible structure , especially because of misuse of code structures Using patterns and methods without understanding why SPAGHETTI CODE
  • 16.
    SOFT CODE Embedding assumptions about the environment of a system in its Storing business logic in configuration files rather than source code HARD CODE
  • 17.
    LAVA FLOW Retaining a part of Retaining undesirable a system that no (redundant or low- longer has any use quality) code because removing it is too expensive or has unpredictable BOAT ANCHOR
  • 18.
    MAGIC STRINGS Including unexplained numbers in algorithms Including literal strings in code, for comparisons, as event types etc. MAGIC NUMBERS
  • 19.
    SINGLE FUNCTION EXIT POINT public Foo merge (Foo a, Foo b) { Foo result; if (a != null) { if (b != null) { // complicated merge code goes here. } else { result = a; } } else { result = b; } return result; }
  • 20.
    GUARD CLAUSE public Foo merge (Foo a, Foo b) { Foo result; if (a != null) { if (b != null) { // complicated merge code goes here. public Foo merge (Foo a, Foo b) { } else { if (a == null) return b; result = a; if (b == null) return a; } // complicated merge code goes here. } else { } result = b; } return result; }
  • 21.
    ARROW ANTI-PATTERN if if if if do something endif endif endif endif
  • 22.
    int foo(void) { char *p = NULL; char *q = NULL; int foo(void) int ret = SUCCESS; { char *p = malloc(SIZEOF_P); p = malloc(SIZEOF_P); char *q = malloc(SIZEOF_Q); if(p) int ret = p && q ? SUCCESS : FAIL; { q = malloc(SIZEOF_Q); if (ret == SUCCESS) if(q) { { /* do something */ /* do something */ } free(q); free(p); } free(q); else ret = FAIL; return ret; } free(p); } else ret = FAIL; return ret; }
  • 23.
    LOOP-SWITCH SEQUENCE // parse a key, a value, then three parameters String key = null; String value = null; List<String> params = new LinkedList<String>(); // parse a key and value String key = stream.parse(); for (int i = 0; i < 5; i++) { String value = stream.parse(); switch (i) { case 0: // parse 3 parameters key = stream.parse(); List<String> params = break; new LinkedList<String>(); case 1: value = stream.parse(); for (int i = 0; i < 3; i++) { break; params.add(stream.parse()); default: } params.add(stream.parse()); break; } }
  • 24.
    Organizational Design AntiPatterns Methodological AntiPatterns Programming AntiPatterns AntiPatterns
  • 25.
    Organizational Design AntiPatterns Methodological AntiPatterns AntiPatterns
  • 26.
    COPY AND PASTE PROGRAMMING TESTER DRIVEN DEVELOPMENT SOMEONE ELSE’S EXAMPLE PROGRAMMING BY PERMUTATION
  • 27.
    Organizational Design AntiPatterns Methodological AntiPatterns AntiPatterns
  • 28.
    Organizational Design AntiPatterns AntiPatterns
  • 29.
    CIRCULAR DEPENDENCY GODOBJECT SEQUENTIAL COUPLING BASE BEAN
  • 30.
    ABSTRACTION INVERSION INNER-PLATFORM EFFECT N-FRAME RACE HAZARD
  • 31.
    ARCHITECTURE BY IMPLICATION
  • 32.
    Organizational Design AntiPatterns AntiPatterns
  • 33.
  • 34.
  • 35.
    ABSTRACTIONIST VS. IMPLEMENTATIONIST “Experts report that only 1 in 5 software developers is able to define good abstractions”
  • 36.
    The point isn'tas much to say "don't do this" as it is to say "you probably don't even realize that you're doing this, but it doesn't work..”
  • 37.
    WE’VE SEEN 26 ANTI-PATTERNS 4 OF DIFFERENT TYPES
  • 38.
    PROJECT MANAGEMENT ANTI-PATTERNS ANALYSISANTI-PATTERNS CONFIGURATION MANAGEMENT ANTI-PATTERNS SOCIAL ANTI-PATTERNS
  • 39.