What is Static/Dynamic Typing

Mohd Akib

Mohd Akib

Creator of Mak Laboratory

Every time you start to learn a new programming language you always hear something about typing let's learn more about it.

Okay, here a thing if you are a beginner or you're working with only one programming you don't even need to bother about the other. As you'll be instinctively deciding on the data types declaration as defined by your programming language. When you start working on more than one programming language you observe such differences. So let's discuss the Type System.

Type System

A type system is a system which comprises of a set of protocol that assigns a type to a variable, function or expression such as string, float, array or boolean. It aims to reduce possibilities for bugs in computer programs. The type system checks happen at runtime( Dynamic Typing ) or during compilation( Static Typing ) of the program. The type system has other functions too.

Statistic Typing

From the above paragraph, it is clear that typing refers to the type checking of the variables, functions, etc during compilation. So Static type checking ensures some level of safety for all inputs in the program. It ensures some level of type safety.

Some of the statically typed programming languages are- C, C++, C#, Java, Haskell, Rust and many more.

Dynamic Typing

Dynamic type checking verifies the type of safety at runtime. This means dynamic casting may cause a program to fail at runtime. s Some of the Dynamically typed programming languages are:- R, Ruby, Javascript, Julia, Python, Perl, etc

Conclusion

Static typing and Dynamic typing are both important topics of programming language design. Each has its own set of advantage and disadvantage and it boils down to personal preference.