In Depth
See Also

Source code

Source code is any series of statements written in some human-readable computer programming language Programming language

A programming language is an artificial language [i] that can be used to control [i] ... 

. In modern programming languages, the source code which constitutes a program is usually in several text files, but the same source code may be printed in a book or recorded on tape . The term is typically used in the context of a particular piece of computer software Computer software

Software fundamentally is the unique image or representation of physical or material alignment that ... 

. 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 an executable Executable

An executable or executable file, in computer science [i], is a file [i] whose conte ... 

 file by a compiler Compiler

A compiler is a computer program [i] that translates text written in a computer language [i] into ano ... 

 for a particular computer architecture Central processing unit

A central processing unit , or sometimes simply processor, is the component in a digital computer [i] ... 

, or executed on the fly from the human readable form with the aid of an interpreter.

Discussions

  Discussion Features

   Ask a question about 'Source code'

   Start a new discussion about 'Source code'

   Answer questions about 'Source code'

   'Source code' discussion forum


Encyclopedia



Source code is any series of statements written in some human-readable computer programming language Programming language

A programming language is an artificial language [i] that can be used to control [i] ... 

.
In modern programming languages, the source code which constitutes a program is usually in several text files, but the same source code may be printed in a book or recorded on tape .
The term is typically used in the context of a particular piece of computer software Computer software

Software fundamentally is the unique image or representation of physical or material alignment that ... 

.
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 an executable Executable

An executable or executable file, in computer science [i], is a file [i] whose conte ... 

 file by a compiler Compiler

A compiler is a computer program [i] that translates text written in a computer language [i] into ano ... 

 for a particular computer architecture Central processing unit

A central processing unit , or sometimes simply processor, is the component in a digital computer [i] ... 

, or executed on the fly from the human readable form with the aid of an interpreter.

The code base of a programming project is the larger collection of all the source code of all the computer programs which make up the project. There is utility in this sort of aggregation as often the same source code file will be used by more than one of a project's different programs.

Purposes

Source code is primarily either used to produce object code , or to be run by an interpreter.

Source code has a number of other uses. It can be used for the description of software. It can also 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 used as a communication tool between experienced programmers, due to its 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 .

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. Binary translation can be used to run a program without source code, but not to maintain it, as the machine code output of a compiler is extremely difficult to read directly. Decompilation can be used to generate source code where none exists, and with some manual effort, maintainable source code can be produced . Programmers frequently borrow source code from one piece of software to use in other projects, a concept which is known as Software reusability.

DevCD's and non-free sourcecode

Sometimes companies provide a "DevCD" that can be purchased through them for the sourcecode for their program. Usually the source would be for a game, so serious gamers can release game mods with the source. Of course, many companies do not do this as they fear that the game could simply be re-compiled with the copyright restrictions and any need for CD-Keys or validation removed, allowing it to be distributed via P2P technology.

An example of a company selling a DevCD is Introversion software, the creator of the computer game Computer and video games

A computer game is a computer [i]-controlled game. ... 

 Uplink. The source has been purchased and mods such as Onlink and the FBI Mod have been created.

Organization

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 C (programming language)

The C programming language is a general-purpose, procedural [i], imperative [i] ... 

, 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 Library (computer science)

In computer science [i], a library is a collection of subprogram [i]s used to develop software [i]. ... 

. 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 Emacs

Emacs is a class of text editor [i]s, possessing an extensive set of features, that are popular with computer programmer [i]... 

 text editor.

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 control system is another tool frequently used by developers for source code maintenance.

Licensing

Software, and its accompanying source code, typically falls within one of two licensing paradigms: Free software Free software

Free software, as defined by the Free Software Foundation [i], is software [i] which can be used, copied ... 

 and Proprietary software. Generally speaking, software is free 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. 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 license.
Frequently source code of commercial software products additionally to licensing requires some protection from decompilation, reverse engineering, analysis and modifications to prevent illegal use intergrating in an application a copy protection Copy protection

Copy protection, also known as copy prevention or copy restriction, is any technical measure... 

.
There are different types of source code protection as code encryption, code obfuscation or code morphing.

Legal issues in the United States

As of 2003, court systems are in the process of deciding whether source code should be considered a Constitutionally protected form of free speech Freedom of speech

Freedom of speech is the concept of being able to speak freely without censorship [i].... 

 in the United States. Proponents of the free speech argument claim that because source code conveys information to programmers, is written in a language, and can be used to share humour and other artistic pursuits, it is a protected form of communication. The opposing view is that source code is functional, more than artistic speech, and is thus not protected by First Amendment First Amendment to the United States Constitution

The First Amendment to the United States Constitution [i] is a part of the United States Bill of Rights [i]... 

 Rights of the U.S. Constitution United States Constitution

The United States Constitution is the supreme law [i] of the United States of America [i]. ... 

.

One of the first court cases regarding the nature of source code as free speech involved University of California University of California

The University of California is a public university [i] system in the state [i] of California [i] ... 

 mathematics Mathematics

Mathematics is the discipline that deals with concepts such as quantity [i], structure [i], space [i] a ... 

 professor Dan Bernstein Daniel J. Bernstein

Daniel Julius Bernstein is a professor [i] at the University of Illinois at Chicago [i], a mathematician [i] ... 

, who had published on the internet the source code for an encryption program that he created. At the time, encryption algorithms were classified as munitions by the United States government; exporting encryption to other countries was considered an issue of national security National security

National security refers to the public policy [i] of maintaining the integrity and survival of the nation-state [i] ... 

, and had to be approved by the State Department United States Department of State

The United States Department of State, often referred to as the State Department, is the Cabinet [i] ... 

. The Electronic Frontier Foundation Electronic Frontier Foundation

The Electronic Frontier Foundation is a non-profit [i] advocacy and legal organization [i] ... 

 sued the U.S. government Federal government of the United States

The government [i] of the United States of America [i], established by the U.S. Constitution [i]... 

 on Bernstein's behalf; the court ruled that source code was free speech, protected by the First Amendment.

In 2000, in a related court case, the issue was again brought under some scrutiny when the Motion Picture Association of America Motion Picture Association of America

he Motion Picture Association of America , originally called the Motion Pictures Producers and Distri... 

  sued the 'hacker' magazine 2600 2600: The Hacker Quarterly

2600: The Hacker Quarterly is a quarterly American [i] publication that specializes in... 

and a number of other websites for distributing the source code to DeCSS DeCSS

DeCSS is a computer program [i] capable of decrypting content on a DVD [i] video disc encrypted [i] ... 

, an algorithm capable of decrypting scrambled DVD DVD

DVD is an optical disc [i] storage [i] media format that can be used for data storage, ... 

 discs. The algorithm was developed to allow people to play legally purchased DVDs on the Linux Linux

Linux is a Unix-like [i] computer operating system [i]. ... 

 operating system Operating system

An operating system is a software program [i] that manages the hardware [i] and software [i] ... 

, which had no DVD software at the time. The US District court decision favored the MPAA; 2600 magazine was prohibited from posting or linking to the source code on their website. This ruling was widely considered a victory for the supporters of the Digital Millennium Copyright Act, as it established a legal precedent for the notion that source code is not Constitutionally protected free speech. It was affirmed by the Appeals Court and as of late 2003 2003

2003 was a common year starting on Wednesday [i] of the Gregorian calendar [i].
... 

 is being appealed to the US Supreme Court.

Quality

The way a program is written can have important consequences for its
maintainers. Many source code programming style guides, which stress readability and some language-specific conventions are aimed at the maintenance of the software source code, which involves debugging and updating. Other issues also come into considering whether code is well written, such as the logical structuring of the code into manageable sections.

Reference

"Using a Decompiler for Real-World Source Recovery", M Van Emmerik and T Waddington, the Working Conference on Reverse Engineering, Delft, Netherlands, 9th-12th November 2004. .

See also

  • Programming language Programming language

    A programming language is an artificial language [i] that can be used to control [i] ... 

  • Legacy code
  • Source code repository
  • Programming style
  • Open source Open source

    Open source describes practices in production and development that promote access to the end product's s... 

  • Open system
  • Open standard
  • Open format
  • Password
  • Vendor lock-in
  • Network effect Network effect

    The network effect is a characteristic that causes a good [i] or service [i] to have a value [i] ... 



External links







Categories: