Source Code
Source Code
http://en.wikipedia.org/wiki/Source_code
Source code
From Wikipedia, the free encyclopedia
In computer science, source code is any collection of computer instructions (possibly with comments) written using some human-readable computer language, usually as 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 a compiler program into low-level machine code understood by the computer. The machine code might then be stored for execution at a later time. Alternatively, an interpreter can be used to analyze and perform the eects of the source code program directly on the y.
Most computer applications are distributed in a form that includes executable les, but not their source code. If the source code were included, it would be useful to a user, programmer, or system administrator, who may wish to modify the program or understand how it works. Aside of its machine-readable forms, source code also appears in books and other media; often in the form of small code snippets, but occasionally complete code bases; a well-known case is the source code of PGP .
An illustration of Java source code with prologue comments indicated in red, inline comments indicated in green, and program statements indicated in blue
Contents
1 2 3 4 5 6 7 8 Denitions Organization Purposes Licensing Legal issues in the United States Quality See also References
1 of 6
03/27/2013 10:03 PM
http://en.wikipedia.org/wiki/Source_code
9 External links
Denitions
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 on Source [1] Code Analysis and Manipulation: 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 [2] graphical representations of systems.
Organization
The source code which constitutes a program is usually held in one or more text les stored on a computer's hard disk; usually these les 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 le or many les. Though the practice is uncommon, a program's source code can [3] be written in dierent 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. This is the case in some languages, such as Java: each class is compiled separately into a le and linked by the interpreter at runtime. Yet another method is to make the main program an interpreter for a [citation needed] , either designed specically for the programming language 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 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,
2 of 6
03/27/2013 10:03 PM
http://en.wikipedia.org/wiki/Source_code
sometimes dozens or even hundreds, of dierent source code les. In these cases, instructions for compilations, such as a Makele, are included with the source code. These describe the relationships among the source code les, 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.
Purposes
Source code is primarily used as input to the process that produces an executable program (i.e., it is compiled or interpreted). It is also used as a method of [4] communicating algorithms between people (e.g., code snippets in books). Programmers often nd it helpful to review existing source code to learn about [4] programming techniques. The sharing of source code between developers is frequently cited as a contributing factor to the maturation of their programming [4] [5] skills. Some people consider source code an expressive artistic medium. Porting software to other computer platforms is usually prohibitively dicult without source code. Without the source code for a particular piece of software, [citation needed] Possible porting portability is generally computationally expensive. options include binary translation and emulation of the original platform. Decompilation of an executable program can be used to generate source code, either in assembly code or in a high level language. Programmers frequently adapt source code from one piece of software to use in other projects, a concept known as software reusability.
Licensing
Main article: Software license Software, and its accompanying source code, typically falls within one of two licensing paradigms: free software 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. Note that "free" refers to freedom, not price. Under many licenses it is acceptable to charge for "free software". The rst free software license to be published and to explicitly grant these freedoms was the GNU General Public License in 1989. The GNU GPL was originally intended to be used with the GNU operating system. The GNU GPL was later adopted by other non-GNU software projects such as the Linux kernel.
3 of 6 03/27/2013 10:03 PM
http://en.wikipedia.org/wiki/Source_code
For proprietary software, the provisions of the various copyright laws, trade secrecy and patents are used to keep the source code closed. Additionally, many pieces of retail software come with an end-user license agreement (EULA) which typically prohibits decompilation, reverse engineering, analysis, modication, or circumventing of copy protection. Types of source code protection beyond traditional compilation to object code include code encryption, code obfuscation or code morphing.
Quality
Main article: Software quality The way a program is written can have important consequences for its maintainers. Coding conventions, which stress readability and some languagespecic conventions, are aimed at the maintenance of the software source code, which involves debugging and updating. Other priorities, such as the speed of the program's execution, or the ability to compile the program for multiple architectures, often make code readability a less important consideration, since code quality depends entirely on its purpose.
See also
Coding conventions Legacy code Machine code Bytecode
4 of 6 03/27/2013 10:03 PM
http://en.wikipedia.org/wiki/Source_code
Obfuscated code Object code Open-source software Programming language Source code repository Syntax highlighting Undened variable
References
1. ^ SCAM Working Conference (http://www.ieee-scam.org/) , 20012010. 2. ^ Why Source Code Analysis and Manipulation Will Always Be Important (http://www.cs.ucl.ac.uk/sta/M.Harman/scam10.pdf) by Mark Harman, 10th IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM 2010). Timioara, Romania, 1213 September 2010. 3. ^ Extending and Embedding the Python Interpreter Python v2.6 Documentation [1] (http://docs.python.org/extending/) 4. ^ a b c Spinellis, D: Code Reading: The Open Source Perspective. Addison-Wesley Professional, 2003. ISBN 0-201-79940-5 5. ^ "Art and Computer Programming" ONLamp.com (http://www.onlamp.com/pub/a /onlamp/2005/06/30/artofprog.html) , (2005)
(VEW04) "Using a Decompiler for Real-World Source Recovery", M. Van Emmerik and T. Waddington, the Working Conference on Reverse Engineering, Delft, Netherlands, 912 November 2004. Extended version of the paper (http://www.itee.uq.edu.au/~emmerik/experience_long.pdf) .
External links
Source Code Denition (http://www.linfo.org/source_code.html) by The Linux Information Project (LINFO) Google public source code search (http://www.google.com/codesearch?) "Obligatory accreditation system for IT security products (2008-09-22), may start from May 2009, reported by Yomiuri on 2009-04-24." (http://www.metalter.com/75061/Obligatory-accreditation-system-for-ITsecurity-products) . MetaFilter.com. http://www.metalter.com/75061 /Obligatory-accreditation-system-for-IT-security-products. Retrieved 2009-04-24. Same program written in multiple languages (http://rosettacode.org /wiki/Main_Page) Retrieved from "http://en.wikipedia.org/w/index.php?title=Source_code& oldid=541980067" Categories: Source code
5 of 6 03/27/2013 10:03 PM
http://en.wikipedia.org/wiki/Source_code
This page was last modied on 4 March 2013 at 01:50. Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. See Terms of Use for details. Wikipedia is a registered trademark of the Wikimedia Foundation, Inc., a non-prot organization.
6 of 6
03/27/2013 10:03 PM