Computer program
![]() | It has been suggested that this article be merged with Computer software, Talk:Computer software#Proposed merge and User:Greenrd. (Discuss) Proposed since April 2007. |
A computer program is a collection of instructions that describes a task, or set of tasks, to be carried out by a computer. More formally, it can be described as an expression of a computational method written in a precisely defined computer language.[1]
Computer programs, also known as software, may be categorized along functional lines. These functional categories include application software, operating systems, video games, and compilers, among others. Computer programs embedded in hardware devices are called firmware.
The formal expression of computational methods in a human-readable computer language is often referred to as source code, while the machine-executable expressions of computational methods are commonly referred to as executables, object code, or simply as binaries — a reference to the binary file format commonly used to store the executable code.
Computational methods and algorithms
Computational methods are a superset of algorithms, and adhere to most of the characteristics of algorithms:
- A computational method must be definite, meaning each step of the algorithm must be precisely defined. Formally defined computer languages meet this criteria by allowing algorithms to be specified in such a way that every statement has a very definite meaning.
- A computational method must have zero or more inputs, or quantities given to it before the algorithm runs.
- A computational method must have one or more outputs which are quantities produced by the method, and will bear some specified relation to the inputs.
- A computational method is generally expected to be effective, meaning that its operations can be performed by hand, accurately and exactly, in a finite amount of time.
Although algorithms are defined to be finite, meaning they must complete in a finite number of steps, computational methods do not have to adhere to this restriction. A computational method theoretically does not have to stop running. Non-finite processes are common in reactive processes, such as operating systems that continually interact with their environment.[2]
Terminology
Commercial computer programs aimed at end users are commonly referred to as application software by the computer industry, as these programs are focused on the functionality of what the computer is being used for (its application), as opposed to being focused on system-level functionality (for example, as the Windows operating system is). In practice, colloquially, both application software and system software may correctly be referred to as programs, as may the more esoteric firmware — software firmly built into an embedded system.
Program execution
A computer program exists in a source code form, viewable as a programming language; as a tokenised form, ready to be interpreted; or in machine code form, ready to be executed. (An aside: source code form may also be interpreted.) Computer programs can be divided into two categories — system software and application software. System software is the operating system that couples the computer's hardware with the application software. Application software couples the system software with the user interface.
A computer program is loaded into memory (usually by the operating system) and then executed ("run"), instruction by instruction, until termination, either with success or through software or hardware error.
Before a computer can execute any sort of program (including the operating system, itself a program), the computer hardware must be initialized. This initialization is done in modern PCs by a piece of software stored on programmable memory chips installed by the manufacturer, called the BIOS. The BIOS will attempt to initialize the boot sequence, making the computer ready for higher-level program execution.
Programs vs. data
The executable form of a program (that is, usually object code) is often treated as being different from the data the program operates on. In some cases this distinction is blurred with programs creating, or modifying, data, which is subsequently executed as part of the same program (this is a common occurrence for programs written in Lisp), see self-modifying code.
Programming
A program is likely to contain a variety of data structures and a variety of different algorithms to operate on them.
Creating a computer program is the iterative process of writing new source code or modifying existing source code, followed by testing, analyzing and refining this code. A person who practices this skill is referred to as a computer programmer or software developer. The sometimes lengthy process of computer programming is now referred to as "software development", or more specifically "software engineering". The latter becoming more popular due to the increasing maturity of the discipline. (See Debate over who is a software engineer.)
Another modern approach is team programming, in which each member of the group has equal say in the development process, except for one person who guides the group through discrepancies. These groups tend to be around 10 people[citation needed] to keep the group manageable. Another approach is referred to as "peer programming" or pair programming.
See Process and methodology for the different aspects of modern computer programming.
Programming languages
The source code of most computer programs consists of a list of instructions that explicitly implement an algorithm (known as an imperative programming style); in another form (known as declarative programming) the characteristics of the required information are specified and the method used to obtain the results, if any, is left to the platform. (See Programming paradigm.)
Computer programs are often written by people (known as computer programmers), but may also be generated by other programs. (See metaprogramming.)
References
- ^ Knuth, Donald E. (1997). The Art of Computer Programming, Volume 1, 3rd Edition. Boston: Addison-Wesley. pp. pp.5. ISBN 0-201-89683-4.
{{cite book}}
:|pages=
has extra text (help) - ^ Knuth, Donald E. (1997). The Art of Computer Programming, Volume 1, 3rd Edition. Boston: Addison-Wesley. pp. pp.4-5. ISBN 0-201-89683-4.
{{cite book}}
:|pages=
has extra text (help)
Further reading
- Knuth, Donald E. (1997). The Art of Computer Programming, Vol. 2, 3rd Ed. Addison-Wesley. ISBN 0-201-89684-2.
{{cite book}}
: Check date values in:|year=
(help)CS1 maint: year (link) - Knuth, Donald E. (1997). The Art of Computer Programming, Vol. 3, 3rd Ed. Addison-Wesley. ISBN 0-201-89685-0.
{{cite book}}
: Check date values in:|year=
(help)CS1 maint: year (link)
External links
- program sigord
- Definition of "Program" at Webopedia
- Definition of "Computer program" at Agtivity
- Definition of "Software" at FOLDOC