Speculative generality smell

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m (See also)
Line 1: Line 1:
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://esinyqynyso.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
 +
----
 +
=[http://esinyqynyso.co.cc CLICK HERE]=
 +
----
 +
</div>
 
This code smell describes a situation where people develop a class with all sorts of hooks and special cases just so it will handle things that might be required in the future but not at this stage. The resulting class is often harder to understand and maintain than if it only tried to handle the things that were actually required.  
 
This code smell describes a situation where people develop a class with all sorts of hooks and special cases just so it will handle things that might be required in the future but not at this stage. The resulting class is often harder to understand and maintain than if it only tried to handle the things that were actually required.  
  

Revision as of 11:10, 24 November 2010


This code smell describes a situation where people develop a class with all sorts of hooks and special cases just so it will handle things that might be required in the future but not at this stage. The resulting class is often harder to understand and maintain than if it only tried to handle the things that were actually required.

Speculative generality can usually be spotted when the only users of a method are test cases. Such methods should be removed unless it contains functionality that is needed by other parts of the system.

This code smell is inline with You ain't gonna need it in that it says that you shouldn't develop functionality unless you need it.

See also


Personal tools