| • Science | • People | • Locations | • Timeline |
In modern programming languages, the source code which constitutes a software program is usually in several text files, but the same source code may be printed in a book or recorded on tape (usually without a filesystem). The term is typically used in the context of a particular piece of computer software. A computer program's source code is the collection of files that can be converted from human-readable form to an equivalent computer-executable form. The source code is either converted into executable by a compiler for a particular computer architecture, or executed from the human readable form with the aid of an interpreter.
Source code is either used to produce object code, or to be run by an interpreter. Modifications are not carried out on object code, but on source code, and then converted again.
Another important purpose of source code is for the description of software. Also, source code has a number of other uses. It can be used as a tool of learning; beginning programmers often find it helpful to review existing source code to learn about programming techniques and methodology. It is also used as a communication tool between experienced programmers, due to its (ideally) concise and unambiguous nature. The sharing of source code between developers is frequently cited as a contributing factor to the maturation of their programming skills. Source code can be an expressive artistic medium; consider, for example, obfuscated code or PerlMonks.Org.
Source code is a vital component in the activity of porting software to alternative computer platforms. Without the source code for a particular piece of software, portability is generally so difficult as to be impractical and even impossible. Programmers frequently borrow source code from one piece of software to use in other projects, a concept which is known as Software reusability.
The source code for a particular piece of software may be contained in a single file or many files. A program's source code is not necessarily all written in the same programming language; for example, it is common for a program to be written primarily in the C programming language, with some 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.
Moderately complex software customarily requires the compilation or assembly of several, sometimes dozens or even hundreds, of different source code files. This complexity is reduced considerably by the inclusion of a Makefile with the source code, which describes the relationships among the source code files, and contains information about how they are to be compiled. The revision controlRevision control is an aspect of documentation control wherein changes to documents are identified by incrementing an associated number or letter code, termed the "revision level", or simply " revision". It has been a standard practice in the maintenance system is another tool frequently used by developers for source code maintenance.
Software, and its accompanying source code, typically falls within one of two licensing paradigms: Free softwareThis article refers to free software as defined by the Free Software Foundation. For software available free of charge, see Freeware. The term free software refers to software which, once obtained, can be used, copied, studied, modified and redistributed. and Proprietary softwareProprietary software is any closed-source material which fundamentally means that the user does not control what it does or cannot study or edit the code. The Free Software Foundation defines it as any software that is not free software or is only partial. Generally speaking, software is free if the source code is freely available, and proprietary if the source code is kept secret, or is privately owned and restricted. The provisions of the various copyright laws are often used for this purpose, though trade secrecy is also relied upon. For a further discussion of the differences between these paradigms, and the divisions within them, see software licenseA software license is a type of proprietary or gratiuitious license as well as a memorandum of contract between a producer and a user of computer software — sometimes called an End User License Agreement (EULA) — that specifies the perimeters of the permi.