Duplicate code smell

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m (See also: - Adding template to each codesmell page)
Line 1: Line 1:
Duplicated code is the smelliest of the code smells. The book ''Refactoring'' [[Martin Fowler 1999]] states that: "If you see the same code structure in more than one place, you can be sure that your program will be better if you find a way to unify them." [[Martin Fowler 1999]] states that the simplest duplicated code problem is when you have the same expression in two methods of the same class.
+
=[http://uvetysudema.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 +
Duplicated code is the smelliest of the code smells. The book ''Refactoring'' [[Martin Fowler 1999]] states that: "If you see the same code structure in more than one place, you can be sure that your program will be better if you find a way to unify them." [[Martin Fowler 1999]] states that the simplest duplicated code problem is when you have the same expression in two methods of the same class.
  
 
It is worth noting that occasionally what appears to be duplicated code is actually two different behaviours that will eventually evolve in different directions.
 
It is worth noting that occasionally what appears to be duplicated code is actually two different behaviours that will eventually evolve in different directions.

Revision as of 07:12, 24 November 2010

Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page

Duplicated code is the smelliest of the code smells. The book Refactoring Martin Fowler 1999 states that: "If you see the same code structure in more than one place, you can be sure that your program will be better if you find a way to unify them." Martin Fowler 1999 states that the simplest duplicated code problem is when you have the same expression in two methods of the same class.

It is worth noting that occasionally what appears to be duplicated code is actually two different behaviours that will eventually evolve in different directions.

Apply Extract Method


See also


Personal tools