What is type safety and what are the “type safe” alternatives? [duplicate]

Type safety means that the compiler can check whether you’re using the right types. For example, if you’re using printf, you could accidentally crash your program by writing this:

printf("The meaning of life is %s", 42);

because 42 is an integer, not a string.

Leave a Comment