One of the five patterns used to describe adaptive programming in the Demeter group at Northeastern University.
Name
Inventor's Paradox (IP)
Purpose
Simplify by solving a more general problem. Applied to programming this means to simplify by writing a more general program [ Adaptive Programming Book ]. Split the program into several loosely-coupled building blocks or aspects. Avoid unnecessary spreading or duplication of information in program building blocks to improve understandability and to reduce size of programs. Use appropriate filters to select what is relevant to one building block from other building blocks. (This pattern is not about any kind of abstraction mechanism in programming but it focusses on those abstraction mechanisms which significantly simplify the solution by solving a much more general problem.)
...
See www.ccs.neu.edu
See also Problem Frame
-vs- You Arent Gonna Need It -- XP's idea, which is nearly the opposite.
Example: You have a Mutually Recursive data structure (A->B, B->A) and must process it (alls A and B). Maybe it is simpler to have A and B both be a C and simplify your recursion to just C->C with some special cases in.
Widely credited to G. Polya's book How To Solve It. At www.cut-the-knot.com he is quoted:
The more ambitious plan may have more chances of success ... provided it is not based on a mere pretension but on some vision of the things beyond those immediately present.
That definitely places it in stark contrast to You Arent Gonna Need It, which seems to explicitly oppose any sort of "vision of the things beyond those immediately present".
See also: www.nous.org.uk
-- Jason Bucata
But You Arent Gonna Need It is accompanied by The Simplest Thing That Could Possibly Work. If the simplest thing is the general case, in XP you would write the general case.
In the first example I ever saw of solving a problem by generalising, the general case could be solved recursively. You had to solve the general case to solve the special case, at least by the simplest method.
See original on c2.com