DAY01-Introduction to programming languages

Source: Internet
Author: User

The purpose of programming

Programming = = Write code/program/software. The purpose of programming is to allow machines (such as computers) to work spontaneously according to the programs that people have written for them beforehand.

classification of programming languages first, machine language

Machine language is a set of machine instructions that can be directly identified and executed by a computer using binary code.

Advantages : Flexible, direct execution and fast speed.

cons : Different models of computers whose machine language is not interlinked, according to a computer machine instructions compiled program, can not be executed on another computer.

Second, assembly language

The language of assembly language is the same as that of machine, which is directly to the hardware, but the instruction is abbreviated in English, and the identifier is easier to recognize and remember. It also requires programmers to write each step of a specific action in the form of a command.

Advantages : Can accomplish the general high-level languages can not achieve the operation, and the source program generated by the compilation of the executable file is relatively small, and execution speed quickly.

disadvantage : The source program is verbose, complex, error prone, and the use of assembly language programming requires more computer expertise.

third, high-level language

Specifically, high-level languages are spoken, and programmed with human-readable (such as English) characters. High-level languages are the choice of most programmers. Compared with assembly language, it not only synthesizes many related machine instructions as a single instruction, but also removes details related to the operation but not relevant to the completion of the work, such as the use of stacks, registers, etc.

advantages : Greatly simplifies the instructions in the program. At the same time, because of the omission of a lot of details, programmers do not need to have too much expertise.

disadvantage : High-level language programming program can not be directly recognized by the computer, must be converted to be executed.

By conversion, you can divide the advanced into two categories:

  • Interpreting class : execution is similar to our daily life "simultaneous translation", the application source code on one side by the corresponding language interpreter "translated" Into the target code (such as a Python program, first translated/compiled into bytecode, and then interpreted by the interpreter execution, the process programmers do not care, enjoy this convenience), Execute
    • benefits on one side : This method is more flexible, debugging program is very convenient, once the program error, immediately debug immediately can test results
    • disadvantage : low efficiency, and cannot produce executable files that can be executed independently, the application cannot leave its interpreter. Only when the program is executed, one by one is interpreted as a machine language for the computer to execute, So the running speed is not as fast as the compiled program.  
  • Compile class : Compile means to "translate" the program source code into a machine instruction and save it as a binary file before the program executes.
    • Advantages : The compiled code can be run directly on the machine and run at a higher speed than the interpreted type.
    • Cons : Debug Program Trouble, once the program needs to be modified, you must first modify the source code, and then recompile to execute.

Summary :

Programming language experience: Machine language--------> assembly language------------> Advanced language

1: Development efficiency from low to high

2: Execution efficiency from high to low

3: Mastering difficulty from difficult to easy

Note : The efficiency of execution is not a problem, the hardware is sufficient, so the development efficiency becomes the key, so the high-level language in today's world is big way.

Mainstream programming languages

In the authoritative language ranking site Tiobe, you can see what the mainstream programming languages are.

DAY01-Introduction to programming languages

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.