In the context of software development, a "generalization" is a broad solution derived from a specific solution. Quite often, generalization happens when one sets out to "solve the general case" for a specific requirement. While general solutions are often "better" by some measure, the act of deriving them carries risk, particularly when the requirements for a general solution are imagined. See PrematureGeneralization. ''Are there generalizations outside of solution space? What is the measure by which general solutions are better? Wouldn't that have to do with a class of problems?'' --- An example of generalization might be to create a function "TwoPlusTwo" with no state or parameters that always returns 32 bit integer 4. This is a very specific function, and of little general use. There are lots of ways to make this function more general and more widely usable. You could add one or two parameters to specify the input values. Independently, you could add a parameter that specified the operation. Also, you could declare it part of a class and give it state, mutating it (perhaps) to a "PlusTwo" function. ----- '''The generalization of a function is a change which increases the size of the domain in which it can be applied.''' Examples: * The "TwoPlusTwo" function is only useful in a context where you need to use the result of "2+2". * The "PlusTwo" function could be used any place where you need to add two -- like if you were making reservations at a restaurant for your group's "couples night out." * The "Plus" function, which adds its two arguments would be useful in any context where you wanted to add to numbers of the appropriate type. * A "Plus" C++ template could be used wherever you wanted to add two arguments of any reasonable type. * The "PerformBinaryOperation" could be used wherever you wanted to perform some binary operation. ''As you can see, as the function becomes more general, you can use it in more places. But, it may also become more difficult to use, may be more difficult to maintain, and may communicate less to the maintainer at the point of call.'' [Try framing the above in terms of mathematical functions and relations, to add a bit of rigor to your arguments. For example, is "two plus two" really a function?] ---- '''A generalization of an item (method, class, whatever) is any action which requires additional specification provided by other items to maintain its original operation.''' * The "TwoPlusTwo" function does not require any specification from other functions. * The "PlusTwo" function and the "Plus" function require additional specification by the caller via parameters. In order to maintain the original operation, the parameters "2" and "2" are required. * An abstract function in a base class requires additional specification (a method body) from a derived class. ---- '''Generalization is language invention.''' ''Think of natural languages rather than focusing on programming languages.'' I would try and abstract away from thinking of programming language/mathematics, and frame this question (or rather, the answer) as a philosophical one; generalization is close to language and understanding. Generalizing a piece of code, introduces a mini language (the subroutines/classes/methods/named things) to the calling code, which to the user (reader) of the code might make it simpler - if the language "makes sense" - or obfuscate, if the language isn't grokable/suiting. Related: LanguageIsGeneralization but do keep in mind that ProgrammingIsManagingDetails. Constant conflict. ---objarni