Prev Up Next
Go backward to 3.7 Algorithm--A Finite and Definite Computational Method
Go up to 3 An Example of Concept Webs: Programming Concepts
Go forward to 3.9 Generic Algorithm Specialized by Input Type

3.8 Generic Programming

Generic programming is a form of programming that emphasizes the design and programming of generic computational methods (also called generic programs), usually by abstracting from collections of definite computational methods. Another definition of generic programming is programming in terms of concepts, as opposed to programming in terms of individual abstractions.

The value of a generic program is that it can replace a large collection of definite programs and is much easier to maintain. There is a crucial concern with efficiency; we are not interested in generic programs whose specializations are so much less efficient than the original programs in the collection that one would be tempted to keep the original collection in spite of the difficulty of maintaining it.

Most current major programming languages provide no support for generic programming. Of the ones that do, the language in widest use is C++, which has template functions and classes that permit direct expression of generic computational methods, though in a limited way. Ada 95 provides a similar level of support with its generic procedures and packages. (Ada 83 was the first major language to provide such support, well before C++ did.)


musser@cs.rpi.edu

Prev Up Next