What the hell is type-safe language?

Visakh Vijayan - Nov 14 '18 - - Dev Community

Consider you are a compiler. Now suppose you are a person who doesn't care about your fellow programmers who are writing code and using you to get them compiled. Like for example:

Someone is assigning an integer(4 bytes) into a char(1 byte) variable.

If you are not careful, that assignment will take away the adjacent 3 bytes away. Poof!.

This is type-unsafe. That is the compiler or YOU are not taking care of such validations before compiling them.

Again this can be at two levels:

  1. Static typing - one which is done at compilation time.
  2. Dynamic typing - one which is done at run-time. This is when you get all those run-time exceptions.

Be type-Safe!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .