Commits

Anonymous committed 5874414

Add duplicate code

Comments (0)

Files changed (3)

         - pass items from one subroutine to another.
             - use objects.
             - assign them to slots.
-
+    - duplicate code.
 
 * Add to the page about best practices:
     - refactoring:
-        - duplicate code.
         - long functions and methods.
 
 * Link to Fomberg's Hebrew with Perl site.

src/tutorials/bad-elements/index.html.wml

 
 </item>
 
+<item id="duplicate_code" h="Duplicate Code">
+
+<p>
+As noted in 
+<a href="http://www.shlomifish.org/philosophy/books-recommends/#refactoring">Martin 
+Fowler's "Refactoring"</a> book (but held as a fact for a long time
+beforehand), 
+<a href="http://en.wikipedia.org/wiki/Duplicate_code">duplicate code</a> is a 
+code smell, and should be avoided. The solution is to extract duplicate
+functionality into subroutines, methods and classes.
+</p>
+
+</item>
 
 </main_list>