From what I understand, dynamic typing is the same as weak typing and strong typing is the same as static typing, but I'm not sure I'm correct.
Strong versus weak is about HOW SERIOUS DO YOU GET while checking the types. You can say that weak typing is relaxed typing, and strong typing is strict typing. Unlike dynamic vs static, the strength of the typing system is a spectrum. JavaScript has very weak typing.
Statically typed languages perform type checking at compile-time, while dynamically-typed languages perform type checking at run-time. Statically-typed languages require you to declare the data types of your variables before you use them, while dynamically-typed languages do not.
Strong typing means that variables do have a type and that the type matters when performing operations on a variable. Dynamic typing means that the type of the variable is determined only during runtime.
A strongly typed programming language is one in which each type of data, such as integers, characters, hexadecimals and packed decimals, is predefined as part of the programming language, and all constants or variables defined for a given program must be described with one of the data types.
Static typing is when your type checking occurs at compile time. You must define a type for your variables inside of your code and any operations you perform on your data would be checked by the compiler.
Dynamic typing is when your type checking occurs at runtime. Instead of errors coming up when you compile your code you will get runtime errors if you try performing operations on incompatible types. However, you will get the benefit of having more versatile functions as they can be written once for multiple data types.
When you have strong typing, you will only be allowed operations on the data by direct manipulation of the objects of that data type.
Weak typing allows you to operate on data without considering its type. Some language do this through pointers. Other languages will convert one of your types to the other before performing the operations.
The links I included have a bit more detailed (and probably clearer) explanations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With