Generic programming allows components which are extensively customizable, yet retain the efficiency of statically configured code. This technique can eliminate dependencies between types and algorithms that are conceptually not necessary.
Generic programming, like object-oriented programming (OOP), relies on a form of polymorphism. The polymorphism in OOP applies at run time to classes related by inheritance.
Generic programming lets us write classes and functions that are polymorphic across unrelated types at compile time.