Computer program: Difference between revisions
JohnWittle (talk | contribs) m Reverted edits by 70.152.105.237 to last version by 67.85.191.19 |
Rewrote the introduction to make it a bit clearer to non-technical people. Only a bit, mind... :) |
||
Line 1: | Line 1: | ||
A '''computer program''' ('''programme''' in Commonwealth English) is a collection of instructions that describe a task (or set of tasks) to be carried out by a computer. In [[imperative programming]] a program consists of a list of instructions that explicitly implement an [[algorithm]]. In [[declarative programming]] (which is much less common), the program lists the characteristics of the required data and leaves algorithm selection to the computer (normally via another dedicated program). |
|||
The |
The term ''computer program'' (or alternatively ''software'', ''[[application software|applications program]]'', ''[[system software]]'' or simply ''program'') can also be used to refer to the actual implementation of a program as a collection of [[source code]] and [[library (computer science)|libraries]] which have been [[compiler|compiled]] into an [[executable file]] or otherwise [[interpreted programming language|interpreted]] to "[[runtime|run]]" in (active) [[computer memory]], where it can perform both automatic and interactive tasks with [[data]]. |
||
Computer programs are written by [[computer programmer]]s. |
Computer programs are written by [[computer programmer]]s using specialised [[programming language]]s. |
||
Note that the term ''software program'' is a [[tautology]] and is redundant in computer use. |
|||
==Terminology== |
==Terminology== |
Revision as of 01:37, 13 November 2006
A computer program (programme in Commonwealth English) is a collection of instructions that describe a task (or set of tasks) to be carried out by a computer. In imperative programming a program consists of a list of instructions that explicitly implement an algorithm. In declarative programming (which is much less common), the program lists the characteristics of the required data and leaves algorithm selection to the computer (normally via another dedicated program).
The term computer program (or alternatively software, applications program, system software or simply program) can also be used to refer to the actual implementation of a program as a collection of source code and libraries which have been compiled into an executable file or otherwise interpreted to "run" in (active) computer memory, where it can perform both automatic and interactive tasks with data.
Computer programs are written by computer programmers using specialised programming languages.
Note that the term software program is a tautology and is redundant in computer use.
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 the 'program categorized by what it is used for' rather than whether it's system software—like the Windows Operating system—which underlies the basic functioning of a computer user's environment. In practice, colloquially, both may correctly be referred to as programs, as may be the more esoteric firmware— a type of software that tells the general purpose computer how to interface to the outside world, or may do more as in embedded systems. In the end, all programs are is a set of instructions in a format understandable by the very limited instruction set of the computer's main processor that causes specific other instructions to execute or perform a simple computation like addition. But computers process thousands of such per second and that is the program, the sequence of instructions strung together to that when executed, doesn't merely make a random mess, but instead does something useful, repeatable, and reliable.
In general discussion among computer programmers the context is invariably sufficient to distinguish which of these possible meanings of the term program is intended, for even their 'standard trade tools,' or 'toolbox', which consists of 'development tools' (or programs) are themselves considered 'Applications software' by the programmers that wrote 'that code'. Indeed, the word 'code' is not infrequently used by programmers among themselves when referring to some aspect of a computer program. (e.g. 'source code', 'Object code', 'assembler code', 'executable code', etc. all dealing with the arcana of turning a program written in some computer language, saved as some text file holding 'source code', feeding it into a 'compiler' program, which produces unlinked object code... etcetera; all parts of a process ending with something called a 'program'.)
For differences in the usage of the spellings program and programme, see American and British English spelling differences.
Program execution
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 software engineering. The latter becoming more popular due to the increasing maturity of the discipline. (see Debate over who is a software engineer)
Two other forms of modern day approaches are team programming where 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 to keep the group manageable. The second form is referred to as "peer programming" or pair programming.
See Process and methodology for the different aspects of modern day computer programming.
Trivia
The world's shortest useful program is usually agreed upon to be the utility cont/rerun used on the old operating system CP/M. It was 2 bytes long (JMP 100), jumping to the start position of the program that had previously been run and so restarting the program, in memory, without loading it from the much slower disks of the 1980's.
According to the International Obfuscated C Code Contest, the world's smallest "program" consisted of a file containing zero bytes, which when run output zero bytes to the screen (also making it the world's smallest self-replicating program). This "program" was qualified as such only due to a flaw in the language of the contest rules, which were soon after modified to require the program to be greater than zero bytes.
Ada Lovelace wrote a set of notes specifying in complete detail a method for calculating Bernoulli numbers with the Analytical Engine described by Charles Babbage. This is recognized as the world's first computer program and she is recognised as the world's first computer programmer by historians.