Dynamic Language and static language, strong type and weak type

Source: Internet
Author: User

1. Dynamic Language and static language
generally, we call Dynamic Language, static language, and dynamic language.
1. Dynamic Language: A dynamic type language is a language that performs data type checks during runtime. That is to say, when programming in a dynamic type language, you never need to specify a data type for any variable. This language records the data type in the internal part when you assign a value to the variable for the first time. Python and Ruby are typical dynamic language. Other scripting languages, such as VBScript, are also dynamic.
2 static type language: static type language is the opposite of dynamic type language, its data type is checked during compilation, that is, the Data Types of all variables must be declared when the Program is written, c/C ++ is a typical representative of static language. Other static language types include C # and Java.
for the distinction between dynamic and static languages, the popular words are static typing when possible and dynamic typing when needed.

2. strong and weak definition languages
1. Strong Type Definition Language: language that enforces data type definition. That is to say, once a variable is specified with a data type, if it is not forcibly converted, it will always be the data type.For example, if you define an integer variable A, it is impossible for the program to treat a as a string type. A strongly typed language is a type-safe language.
 
2 weak type definition language:Language in which data types can be ignored. It is opposite to a strongly typed definition language. A variable can assign values of different data types.
The speed of a strong-type definition language may be slightly inferior to that of a weak-type definition language, but the rigor of a strong-type definition language can effectively avoid many errors. In addition, there is no connection between "is this language a Dynamic Language" and "is this language a type of security!
For example, python is a dynamic language, a strong Type Definition Language (Type-safe language), VBScript is a dynamic language, and a weak Type Definition Language (Type-insecure language ); java is a static language and a strong Type Definition Language (type security language ).

A strong language is a language that requires variable/object type declaration. Generally, compilation and execution are required. For example, C/C ++/Java/C #

A weak type language is a language that does not need to declare variables or object types. Generally, compilation is not required (but compilation is also required ). For example, PHP/asp/Ruby/Python/perl/ABAP/SQL/JavaScript/Unix shell

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.