Computer program

Jump to: navigation, search

A computer program is a collection of instructions that describes a task, or set of tasks, to be carried out by a computer.[citation needed] More formally, computer programs can be described as an expression of a computational method written in a computer language.[1]

Computer programs 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.

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

Computer programming is the iterative process of writing or editing 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 usually referred to as software development, with the term software engineering becoming more popular as the process comes to be seen as an engineering discipline.

One approach to this process 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. Another approach is referred to as peer programming or pair programming.

A program is likely to contain a variety of data structures and a variety of different algorithms to operate on them.

Programming languages

Computer programs are often written by people (known as computer programmers), but may also be generated by other programs - an example of metaprogramming.

Various programming paradigms can be employed in software development. 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. Examples of programming languages include C, JavaScript, and Lisp.

Computational methods and algorithms

Computational methods are a superset of algorithms, and adhere to most of the characteristics of algorithms:

  1. A computational method must be definite, meaning each step of the algorithm must be precisely defined. Formally defined computer languages meet this criterion by allowing algorithms to be specified in such a way that every statement has a very definite meaning.
  2. A computational method must have zero or more inputs, or quantities given to it before the algorithm runs.
  3. 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.
  4. 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]

References

  1. "An expression of a computational method in a computer language is called a program." Knuth, Donald E. (1997). The Art of Computer Programming, Volume 1, 3rd Edition. Boston: Addison-Wesley. pp. pp.5. ISBN 0-201-89683-4.
  2. 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.

Further reading

  • Knuth, Donald E. (1997). The Art of Computer Programming, Vol. 2, 3rd Ed. Addison-Wesley. ISBN 0-201-89684-2. Check date values in: |year= (help)
  • Knuth, Donald E. (1997). The Art of Computer Programming, Vol. 3, 3rd Ed. Addison-Wesley. ISBN 0-201-89685-0. Check date values in: |year= (help)

External links

zh-min-nan:Tiān-náu thêng-sek be-x-old:Праграма bs:Računarski program ca:Programa informàtic cs:Počítačový program de:Computerprogramm et:Arvutiprogramm fa:برنامه (رایانه) ga:Ríomhchlár ko:프로그램 hr:Računalni program io:Programo id:Program komputer is:Tölvuforrit it:Programma (informatica) he:תוכנית מחשב kk:Компьютерлік бағдарлама lo:ໂປແກມ ຄອມພິວເຕີ lv:Datorprogramma nl:Computerprogramma simple:Computer program fi:Tietokoneohjelma sv:Datorprogram th:โปรแกรมคอมพิวเตอร์ ur:شمارندی برنامج yi:קאמפיוטער פראגראם



Linked-in.jpg