Home  >  Article  >  What does source program mean?

What does source program mean?

青灯夜游
青灯夜游Original
2020-10-23 10:23:5869563browse

Source program, also known as source code, refers to an uncompiled text file written in accordance with certain programming language specifications. It is a series of human-readable computer language instructions. The ultimate goal of a computer source program is to translate human-readable text into binary instructions that a computer can execute. This process is called compilation and is completed through a compiler.

What does source program mean?

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

Source program, also known as source code, refers to an uncompiled text file written according to certain programming language specifications. It refers to a series of human-readable computer language instructions, usually written in a high-level language.

In modern programming languages, source programs can appear in the form of books or tapes or other carriers, but the most commonly used format is text files. The purpose of this typical format is to compile a computer program.

The ultimate goal of a computer source program is to translate human-readable text into binary instructions that a computer can execute. This process is called compilation and is completed through a compiler.

The source program file type refers to the special encoding method used when storing the source program, which is easy to read and identify. Text files are the most commonly used file type, but many high-level languages ​​and assembly languages ​​have their own file types. It is generally customary to save them in high-level language or assembly language file types, mainly for the convenience of later compilation by the compiler.

Function

The main functions of the source code have the following two functions:

  • Generate target code, that is, the computer can recognize it code.

  • Describe the software, that is, explain the writing of the software. Many beginners, and even a few experienced programmers, ignore the writing of software descriptions; because this part will not be directly displayed in the generated program, nor will it be involved in compilation. But it shows that it has huge benefits for software learning, sharing, maintenance and software reuse. Therefore, writing software descriptions is considered a good habit in the industry to create excellent programs, and some companies also make it mandatory to write it.

It should be pointed out that for compiled languages, such as C/C/Java, modification of the source code cannot change the generated target code. If the target code needs to be modified accordingly, it must be recompiled. However, there are currently many popular scripting languages, such as Perl/Python, which do not require recompilation. After modifying the code, you can directly execute it and see the results of the modification.

Code combination

Source code, as a special part of the software, may be included in one or more files. A program does not have to be written in the same format as source code. For example, if a program is supported by a C language library, it can be written in C language; while another part can be written in assembly language in order to achieve higher operating efficiency. As far as the current situation is concerned, there is very little software that needs to be written directly in assembly language, because many times the optimization program generated by the compiler is already very efficient, and more often it is compiled using C/C. Language to write the parts of the core that require speed, and dynamic languages ​​such as Perl/Python/Lua to do core extensions, such as interfaces, management configurations, etc. This will neither lose efficiency nor increase the flexibility of the program.

More complex software generally requires the participation of dozens or even hundreds of source codes. In order to reduce this complexity, a system that can describe the relationship between each source code and how to compile it correctly must be introduced. In this context, version control systems (VCS) were born and became one of the necessary tools for developers to revise code.

There is another combination: porting software written for one platform to another platform, such as porting software under Windows to Linux or MacOS. The professional term is called software transplantation. Generally, software that can run on multiple platforms is called cross-platform software.

Quality and Efficiency

For computers, there is no "good" source code in the true sense; a good source program must first be correct code . Then there is the maintainability of the source program. Good programming style will enhance the maintainability of the code. Whether the source code is readable has become one of the criteria for code quality/quality. Others put program efficiency before maintainability. Many people have different views on source code quality/quality depending on the functions and application areas that the program is intended to implement. But there is general agreement that quality/quality source programs are correct programs.

Although we can implement the same function of the computer through different languages, there are differences in execution efficiency. The general rule is: the more advanced the language, the lower its execution efficiency. This is also the reason why files generated by assembly language are generally smaller than files generated by VB language. However, although using low-level languages ​​can improve operating efficiency, it will greatly reduce program development efficiency and may make development work very difficult. Therefore, most programmers do not care about the loss of operating efficiency caused by high-level languages. At most, they only focus on key areas. Use low-level language.

For more programming-related knowledge, please visit: Introduction to Programming! !

The above is the detailed content of What does source program mean?. 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