Generic Programming
Programs where types are specified later. Usually, the "type to be specified later" is denoted by a placeholder.
In addition to helping reusability, this is also safer than Type Systems#Casting, which can be error-prone.
Compile time checks
-
Restrictions: This might seem to be a type safety disaster, but strongly typed languages allow these generic types to be constrained by the programmer.
-
Flexibility: Languages also allow wildcards or some sort of type variance when the type is unclear while using it. This also allows for some Type Systems#Variance when dealing with types.
For example, method parameters can be variant in OOP, but if required you can make them contravariant using generic type wildcards.
Metaprogramming
Technique which helps write generic programs, by allowing program to read and manipulate information about their own or other program's metadata at runtime, like type and names.
A lot of languages like Java and ABAP offer these functionalities.
Introspection
When a program is able to read or examine the type or properties at runtime.
Reflection
Reflection goes a step further from introspection. Its when a program can manipulate the type or properties at runtime.
References
- Generic programming - Wikipedia
- Metaprogramming - Wikipedia
- Type introspection - Wikipedia.)
- [Reflective programming - Wikipedia](https://en.wikipedia.org/wiki/Reflective_programming
- Is metaprogramming a subset of reflection? - Stack Overflow
- language agnostic - What is the difference between introspection and reflection? - Stack Overflow