I. Meaning
Code is a source file written by programmers in the language supported by development tools. It is a set of clear rules, and information is represented in discrete form by characters, symbols or signal elements.
The principles of code design include uniqueness, standardization and universality, expansibility and stability, easy identification and memory, short and unified format and easy modification. Source code is a branch of code. In a sense, source code is equivalent to code. In modern programming languages, source code can appear in the form of books or tapes, but the most commonly used format is text files. The purpose of this typical format is to compile computer programs. The ultimate goal of computer source code is to translate human-readable text into computer-executable binary instructions. This process is called compilation and is completed by the compiler.
Second, the role
The main functions of the source code are as follows:
Generate the target code, that is, the code that the computer can recognize.
Explain the software, that is, explain the writing of the software. Many beginners, even a few experienced programmers, ignore the compilation of software instructions, because this part will not be directly displayed in the generated program and will not participate in the compilation. However, it is of great benefit to software learning, sharing, maintenance and software reuse. Therefore, writing software instructions is considered to be a good habit to create excellent programs in the industry, and some companies also force it to be written.
It should be pointed out that modifying the source code cannot change the generated target code. If the target code needs to be modified accordingly, it must be recompiled.
Third, code combination.
As a special part of software, the source code may be contained in one or more files. A program does not have to be written in the same source code format. For example, if a program has the support of C language library, then it can use C language; The other part can be written in assembly language to achieve higher operating efficiency.
More complex software generally requires the participation of dozens or even hundreds of source codes. In order to reduce this complexity, we must introduce a system that can describe the relationship between various source codes and how to compile them correctly. In this context, the revision control system (RCS) was born and became one of the necessary tools for developers to revise code.
There is also a combination: the source code is written and compiled on different platforms, and the technical term is software transplantation.