Actions

Source Code

Revision as of 18:52, 16 January 2020 by User (talk | contribs)

Source Code is the source of a computer program. It contains declarations, instructions, functions, loops and other statements, which act as instructions for the program on how to function. Programs may contain one or more source code text files, which can be stored on a computer's hard disk, in a database, or be printed in books of code snippets.

Programmers can add comments to their source code to help other developers understand it. Short scripts can also be run from source code using a scripting engine such as VBScript or the PHP engine. While large programs frequently reference hundreds or thousands of files, it is not uncommon for small programs to use just one source code. If there are many source files, the program may be organized into different sections. If a single file contains all the program's variables and functions, it can be hard to locate specific sections of the code.[1]

Beyond providing the foundation for software creation, source code has other important purposes, as well. For example, skilled users who have access to source code can more easily customize software installations, if needed. Meanwhile, other developers can use source code to create similar programs for other operating platforms -- a task that would be trickier without the coding instructions. Access to source code also allows programmers to contribute to their community, either through sharing code for learning purposes or by recycling portions of it for other applications.[2]

Source code can be either proprietary or open. Many companies closely guard their source code. Users can use the compiled code, but they cannot see or modify it. Microsoft Office is an example of proprietary source code. Other companies post their code on the internet where it is free to anyone to download. Apache OpenOffice is an example of open source software code.[3]

The source code which constitutes a program is usually held in one or more text files stored on a computer's hard disk; usually these files are carefully arranged into a directory tree, known as a source tree. Source code can also be stored in a database (as is common for stored procedures) or elsewhere. The source code for a particular piece of software may be contained in a single file or many files. Though the practice is uncommon, a program's source code can be written in different programming languages. For example, a program written primarily in the C programming language, might have portions written in assembly language for optimization purposes. It is also possible for some components of a piece of software to be written and compiled separately, in an arbitrary programming language, and later integrated into the software using a technique called library linking. In some languages, such as Java, this can be done at run time (each class is compiled into a separate file that is linked by the interpreter at runtime). Yet another method is to make the main program an interpreter for a programming language,[citation needed] either designed specifically for the application in question or general-purpose, and then write the bulk of the actual user functionality as macros or other forms of add-ins in this language, an approach taken for example by the GNU Emacs text editor. The code base of a computer programming project is the larger collection of all the source code of all the computer programs which make up the project. It has become common practice to maintain code bases in version control systems. Moderately complex software customarily requires the compilation or assembly of several, sometimes dozens or maybe even hundreds, of different source code files. In these cases, instructions for compilations, such as a Makefile, are included with the source code. These describe the programming relationships among the source code files, and contain information about how they are to be compiled.[4]

  1. Defining and Explaining Source Code Techopedia
  2. Purpose of a Source Code Techtarget
  3. Source Code Licensing ThoughtCo
  4. Organization of Source Code Wikipedia