Difference between Strong vs Static Typing AND Weak vs Dynamic Typing

左心房为你撑大大i 提交于 2019-12-02 15:06:53
Boumbles

Static typing vs dynamic typing:

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.

Strong typing vs weak typing:

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!