type-generic programming
nounUK /taɪp dʒəˈnɛrɪk ˈprəʊɡræmɪŋ/
US /taɪp dʒəˈnɛrɪk ˈproʊɡræmɪŋ/
A way of writing computer code that works with many kinds of data without being rewritten for each one.
Using type-generic programming, the same sorting function can handle lists of numbers, words, or any other type.
OTHER MEANINGS
2. A style of coding where algorithms are written once and reused across multiple data types.
The library relies on type-generic programming to provide containers for any element type.
3. In languages like C++, the technique of using templates to create type-independent code.
C++ templates are a classic example of type-generic programming.
4. A design approach that separates algorithms from the specific types they operate on.
Type-generic programming lets developers swap data types without changing the algorithm.