Home  >  Article  >  Pseudocode is computer language

Pseudocode is computer language

(*-*)浩
(*-*)浩Original
2019-07-26 13:13:005855browse

Pseudocode is an informal, English-structured language used to describe module structure diagrams.

Pseudocode is computer language

People realize when implementing the same algorithm in different programming languages ​​that their implementation (note: this is implementation, not function) are very different. (Recommended learning: PHP video tutorial)

It may be difficult especially for programmers who are proficient in different programming languages ​​to understand a function (of a program written in other programming languages) , because the form of the programming language limits the programmer's understanding of key parts of the program. In this way, pseudocode came into being. Pseudocode provides more design information, and the description of each module must appear together with the design structure diagram.

The purpose of using pseudocode is to make the described algorithm easy to implement in any programming language (Pascal, C, Java, etc.).

Therefore, pseudocode must have a clear structure, simple code, good readability, and resemble natural language. Between natural language and programming language. Specify algorithm functions in writing in a programming language. Use pseudocode and don't stick to specific implementations.

Compared with programming languages ​​(such as Java, C, C, Dephi, etc.), it is more similar to natural language. It is a half-width, non-standard language. The structure of the entire algorithm running process can be described in a form close to natural language (you can use any text you are familiar with, the key is to express the meaning of the program).

Pseudocode is often applied when considering the function of an algorithm (rather than its language implementation).

Pseudocode is often used in technical documentation and scientific publications to represent algorithms, and is also used to express the logic of a program before the actual coding process of software development. Pseudocode is not a tool for users and analysts, but for designers and programmers. Computer science often uses virtual code in teaching so that it can be understood by all programmers.

To sum up, simply put, it is code that is easy to understand. It is independent of language and is used to represent the program execution process, but may not necessarily compile and run the code. It is used a lot when talking about algorithms in data structures. Pseudocode is used to express what a programmer is thinking before they start coding.

Pseudocode: It uses words and symbols (including mathematical symbols) between natural language and computer language to describe algorithms.

For example, the grammatical rules of pseudocode in a Pascal-like language are: in the pseudocode, each instruction occupies one line (else if, exception). The instruction is not followed by any symbols (statements in Pascal and C must end with a semicolon).

The "indentation" in writing indicates the branch program structure in the program. This indentation style also applies to if-then-else statements. Using indentation to replace the begin and end statements in traditional Pascal to represent the block structure of the program can greatly improve the clarity of the code.

For more PHP-related technical articles, please visit the PHP Graphic Tutorial column to learn!

The above is the detailed content of Pseudocode is computer language. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn