How do statically-typed languages deal without generics? -


i'm curious statically-typed languages have no generics support (and lesser extent languages historically did not have generics), , how deal it.

do users cast on place? there special sauce basic collections, lists , dictionaries, allow types generic?

why these languages not have generics? avoid potential complexity or other reasons?

c—and historical c++, before called c++—requires either manually expand "generic" types non-generics (i.e. c preprocessor macro equivalent of c++ templates) or escape type system (i.e. void pointers).

however, arrays (lists) treated composite types rather single type. can have array of shorts, example, not treat same array of chars or of longs.

this isn't big problem in c, though inconvenient @ times. represent trade-off 40 years ago, put in context.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -