In computing, source code is any collection of computer instructions, possibly with comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source code. The source code is often transformed by an assembler or compiler into binary machine code understood by the computer. The machine code might then be stored for execution at a later time. Alternatively, source code may be interpreted and thus immediately executed. Most application software is distributed in a form that includes only executable files. If the source code were included it would be useful to a user, programmer or a system administrator, any of whom might wish to study or modify the program.
1 Definitions 2 History 3 Organization 4 Purposes 5 Legal aspects
6 Quality 7 See also 8 References 9 External links
Definitions The Linux Information Project defines source code as:
The notion of source code may also be taken more broadly, to include
machine code and notations in graphical languages, neither of which
are textual in nature. An example from an article presented on the
annual IEEE conference and on
For the purpose of clarity "source code" is taken to mean any fully executable description of a software system. It is therefore so construed as to include machine code, very high level languages and executable graphical representations of systems.
Often there are several steps of program translation or minification
between the original source code typed by a human and an executable
program. While some, like the FSF, argue that an intermediate file "is
not real source code and does not count as source code", others
find it convenient to refer to each intermediate file as the source
code for the next steps.
The earliest programs for stored-program computers were entered in
binary through the front panel switches of the computer. This
first-generation programming language had no distinction between
source code and machine code.
When IBM first offered software to work with its machine, the source
code was provided at no additional charge. At that time, the cost of
developing and supporting software was included in the price of the
hardware. For decades, IBM distributed source code with its software
product licenses, after 1999.
Most early computer magazines published source code as type-in
Occasionally the entire source code to a large program is published as
a hardback book, such as Computers and Typesetting, vol. B: TeX, The
Program by Donald Knuth, PGP
A more complex Java source code example. Written in object-oriented programming style, it demonstrates boilerplate code. With prologue comments indicated in red, inline comments indicated in green, and program statements indicated in blue.
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, 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 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.
The revision control system is another tool frequently used by
developers for source code maintenance.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
An author of a non-trivial work like software, has several
exclusive rights, among them the copyright for the source code and
object code. The author has the right and possibility to grant
customers and users of his software some of his exclusive rights in
form of software licensing. Software, and its accompanying source
code, can be associated with several licensing paradigms; the most
important distinction is open source vs proprietary software. This is
done by including a copyright notice that declares licensing terms. If
no notice is found, then the default of All rights reserved is
Generally speaking, software is open source if the source code is free
to use, distribute, modify and study, and proprietary if the source
code is kept secret, or is privately owned and restricted. One of the
first software licenses to be published and to explicitly grant these
freedoms was the
GNU General Public License
Code as data
Package (package management system)
^ a b "Programming in C: A Tutorial" (PDF). Archived from the original
(PDF) on 23 February 2015.
^ The Linux Information Project. "
(VEW04) "Using a Decompiler for Real-World Source Recovery", M. Van Emmerik and T. Waddington, the Working Conference on Reverse Engineering, Delft, Netherlands, 9–12 November 2004. Extended version of the paper.
Look up code or source code in Wiktionary, the free dictionary.
Wikimedia Commons has media related to Source code.
LCCN: sh90003519 GND: 4488209-9 SUDOC: 12859683X BNF: