Typing discipline: Static

Static typing implies that all type checking is done during compile-time (as opposed to run-time). Types are associated with variables (as opposed to values).

Compile-time checks use only the code itself. The advantage of this approach is that it’s enough to perform the checks only once per change of program code. Once the constraint is verified, is will hold for all future executions of the program. Besides, absence of runtime checks and knowing data types at compile-time allows to make the compiled program more efficient.

Static typing allows to find type errors in rarely used code paths at compile time.

Static typing is used in most compilable programming languages.

Static typing is the opposite of dynamic typing.

Programming languages that uses this typing discipline: