Type checking is the process of checking proper data type i.e., constraints during program execution. It can be checked during runtime (dynamically typed language) or compile time (statically typed language).
Type checking ensure your code to certain guarantees. It helps in production environment by eliminating the bugs earlier.
There are two types of type checking.
Static type checking is done at compile time. It checks every variable and constants to make sure they’re being used as per declared data type. This type of type checking helps programmer to caught errors early in the development cycle.
Some examples of statically typed languages include C, C++, Java, Fortran, Pascal, Scala etc.
Advantages:
Dynamic type checking is done at run time. It provides less interruption every time you want to check your results of some change. In order to check the result correctly, it has to be able to determine the type of every value at run-time. Some examples of dynamically typed language include PHP, Python, Ruby etc.
Advantages: