Generic Programming

Read this text, which discusses the basics of generic programming and relates it to different languages.

1. Introduction

Generic programming is a style of computer programming in which algorithms are written in terms of types to-be-specified-later that are then instantiated when needed for specific types provided as parameters. This approach, pioneered by the ML programming language in 1973, permits writing common functions or types that differ only in the set of types on which they operate when used, thus reducing duplication. Such software entities are known as generics in Python, Ada, C#, Delphi, Eiffel, F#, Java, Nim, Rust, Swift, TypeScript and Visual Basic. NET. They are known as parametric polymorphism in ML , Scala , Julia , and Haskell (the Haskell community also uses the term "generic" for a related but somewhat different concept); templates in C++ and D; and parameterized types in the influential 1994 book Design Patterns.


Source: Wikipedia, https://en.wikipedia.org/wiki/Generic_programming
Creative Commons License This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.