Basic knowledge points of programming language

1. What is a programming language

The essence of a programming language is a language, which is the same as the Chinese and English used by us, that is, a tool for communicating with another business, and a programming language is a tool for communicating with a computer;

2. Machine language

Machine language is the binary that the computer can directly understand, and machine language programming means direct use of binary programming;

Advantages: The program written by it can be understood by the computer without barriers, and the execution efficiency is high;

Disadvantages: low development efficiency due to complexity, dependence on specific hardware, poor cross-platform;

3. Assembly language

Assembly language uses an English label to correspond to a set of binary instructions. Compared with machine language, it is an improvement, and the essence is to directly operate the hardware;

Advantages: English label writing, reduced complexity compared to machine language, and high execution efficiency;

Disadvantages: rely on specific hardware, poor cross-platform, low development efficiency;

4. High-level language

The high-level language is to write programs with characters that people can understand. The execution is to send instructions to the operating system, not to directly manipulate the hardware. The high-level language is built on the operating system. The use of high-level language does not need to consider the hardware details, and the development efficiency is obtained. Greatly improved, due to the use of human characters to compile, the computer needs translation to understand, the execution efficiency is lower than the underlying language;

Due to the different translation methods, it can be divided into two types: compiled and interpreted;

4.1 Compiled

Compiled type will compile the program into binary instructions that the computer can recognize, and then the operating system will take the compiled instructions to operate the hardware (such as C language);

Advantages: The results obtained by compiling once can be executed repeatedly without compiling again;

Disadvantages: The compiled code results are only valid for the currently executing platform, and cannot be cross-platform;

4.2 Interpretative

The execution of the code requires an interpreter, which will translate while executing (such as Python);

Advantages: The operation depends on the interpreter, and different platforms have corresponding interpreters, which is strong across platforms;

Disadvantages: translation is required for each execution;

5. Weak and strongly typed languages

Weak type:
a language whose data type can be ignored. For example, the shell language of Linux defines a variable. With the different calling methods, the data type can be switched at will.

Strong type:
language with emphasis on data types, that is, once the data type of a variable is defined, it will not change unless a strong conversion operation is performed (such as Python);

6. Dynamic and static languages

Dynamic type: The
data type is checked at runtime, that is, the data type of the variable is determined when the variable is assigned, and there is no need to specify the data type for the variable in advance;

Static type: It is
necessary to define the data type of the variable in advance;

7. Efficiency comparison

Execution efficiency: machine language> assembly language> high-level language (compiled type> interpreted type)

Development efficiency: machine language <assembly language <high-level language (compiled type <interpreted type)

Guess you like

Origin blog.csdn.net/msmso/article/details/108606929