Is dynamically and statically typed programming languages the same as strongly and weakly typed programming languages

Ekwueme OnyinyeEkwueme Onyinye
2 min read

I think this is something every beginner in programming should know and understand.

Dynamically typed programming languages

A dynamically typed programming language is one where the type of a variable is checked during runtime, rather than at compile time. This means that the type of a variable is not fixed when the code is written, and can change during the execution of the program based on the value it holds. Some advantages are: Faster development, Increased flexibility and Concise syntax. Examples are Javascript and PHP.

Statically typed programming languages

A statically typed language is a programming language where the type of each variable is known at compile time. This means the programmer must explicitly declare the type of each variable, or the language may infer the type at compile time. Some advantages are: Reduced runtime errors , Improved code reliability and Better code organization. Examples are C and C++.

Strongly typed programming languages

A strongly typed programming language is one where each variable has a predefined data type, and the language enforces strict rules about how these types can be used and converted. It prevents operations on incompatible types and reducing the likelihood of errors. Examples are Java and Python.

Weakly typed programming languages

weakly typed programming language, also known as a loosely typed language, is one where the type of a variable is not strictly enforced. This means that the language allows for implicit type conversions and may not always require explicit type declarations. Examples are PHP and C.

So basically, we can see that;

  • Statically and Dynamically typed: Focus on when type checking occurs with statically being at compile time and dynamically being at runtime.

  • Strong vs. Weak: Focuses on how strictly the language enforces type rules and handles type conversions.

0
Subscribe to my newsletter

Read articles from Ekwueme Onyinye directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ekwueme Onyinye
Ekwueme Onyinye