Posts Tagged "templates"

Duplication in your code. Also, duplication. And duplication.

»Posted by on Sep 24, 2009 in Blog, Coding, Technology thoughts | 0 comments

Duplication in your code.  Also, duplication.  And duplication.

From the department of redundancy department, IT coder division: Duplication is probably the single, most important thing to banish from your code. Duplication can take several forms:   textual This is the simplest and often the easiest to find. This is when you have sections of code that are identical or nearly so. This is often a result of copy & paste programming. Several techniques can be used to eliminate it, including: extracting methods and reusing them, making a method into a template method, pulling it up into a superclass, and providing the variations in subclasses, and other basic refactorings. See Fowler’s “Refactoring” for more detail. functional This is a special case of textual duplication and is present when you have multiple...

read more