4 ms·
> You have it exactly backwards. Generics and interfaces are commitments to formalism and the promises of static typing. Before that there was ‘void’, the canon
by BerislavLopac 9y ago
> You have it exactly backwards. Generics and interfaces are commitments to formalism and the promises of static typing. Before that there was ‘void’, the canonical dynamic type. ‘void’ (or ‘Object’ in Java and other static OOPs) became less common, not more.
This has nothing to do with dynamic/static typing and everything to do with weak/strong typing.
- weberc2 9y agoYou’re mistaken. In C, void pointers (the “dynamic type” in C) were used to make algorithms generic. This would be necessary regardless of whether or not C was strongly typed. For instance, Go is strongly typed but lacks generics, and it too needs a dynamic type (interface{}) to produce many generic algorithms.