LINFO

Program Definition



A program is a sequence of instructions understandable by a computer's central processing unit (CPU) that indicates which operations the computer should perform on a set of data.

Ready-to-run programs are stored as executable files that reside in storage, but they are copied into memory when they are launched so that their machine code will be immediately available to the CPU, which is the main logic unit of a computer. Storage refers to devices or media that can retain data for relatively long periods of time (e.g., years or even decades), such as hard disk drives (HDDs), floppy disks, optical disks (e.g., CDROMs and DVDs) and magnetic tape. This contrasts with memory, whose contents are retained only temporarily (i.e., while in use or only as long as the power supply remains on) but which can be accessed (i.e., read and written to) at extremely high speeds.

An executable file is a file that has been converted from source code into machine code, which is directly understandable by the CPU, by a specialized program called a compiler. Source code is the version of software as it is originally written (i.e., typed into a computer) by a human in plain text (i.e., human readable alphanumeric characters). Source code can be written in any of the hundreds of programming languages that have been developed, some of the most popular of these are C, C++, Cobol, Fortran, Java, Perl, PHP, Python and Tcl/Tk.

Software is usually used as a generic term for programs. However, in its broadest sense it can refer to all information (i.e., both programs and data) in electronic form and can provide a distinction from hardware, which refers to computers or other electronic systems on which software can exist and be used.

Programs are often divided into two broad categories: systems programs and application programs. The former refers to operating systems and utility programs that manage computer resources at a low level, that is, that enable a computer to function. Examples of such utilities include compilers, device drivers and the X Window System (which provides basic graphic capabilities on Unix-like operating systems). Examples of major categories of application programs are word processors, graphic image processing programs, database management systems and games. Many computer users are only familiar with application programs may not even realize that systems programs exist.

A program remains just a passive file (or collection of files) until it is launched, at which time it spawns (i.e., gives birth to) one or more processes. A process can be thought of as a running instance of a program. On multitasking operating systems (i.e., systems that allow multiple processes to run seemingly simultaneously), multiple instances of a program can run concurrently, each of which is a different process (or set of processes).

Programs are commonly launched directly by a user by clicking on an icon (i.e., a small image representing the program) in a GUI (graphical user interface) or by typing in a command at the command line (i.e., all-text user interface) and then pressing the ENTER key. Some programs are launched automatically by the system as it boots up (i.e., starts up) or in response to certain events.

A command is an instruction telling a computer to do something, such as launch a program. It consists of the name of one or more programs and any options and arguments for each command. An option is a (usually) single letter code that modifies the behavior of a command line program (i.e., a program that operates in the all-text mode) in some specific way. An argument is a file name or other input data for such a program. The ability of command line programs to use options and arguments adds greatly to their flexibility.

Executable programs are usually stored in one of several standard directories on Unix-like operating systems, including /bin, /sbin, /usr/bin, /usr/sbin and /usr/local/bin. Although it is not necessary for them to be in these locations in order to be operable, it is often more convenient.

Programs can range all the way in size and complexity from just a few lines of code that merely displays a simple phrase such as Hello World on the monitor screen to a massive operating system that contains hundreds of megabytes of code.

Many of the most widely used computer programs are proprietary (i.e., commercial) software, which is usually not available free of charge and for which there are generally severe restrictions on its use. However, the past several years have seen a rapid growth in the development and use of free software, which refers to programs that can be obtained at no monetary cost and that can be used for any desired purpose, including modifying, copying, using on as many computers as desired, giving away and even selling.

In contrast to many types of products, the quality and value of programs should definitely not be judged on the basis of their price. This is because many free programs have features and performance as good as or superior to their non-free counterparts, plus they also have the additional advantages of not having any onerous EULAs (end user licensing agreements) and allowing users to modify them in any way desired. In fact, some of the most popular programs are free software (e.g., the Apache Web Server, which hosts more than 70 percent of all web sites on the Internet web sites).

Likewise, programs should not be judged on the basis of their size. An important tenet of the Unix philosophy is that programs should be purposely made as small as possible and that they should be designed do only one thing but do it well. This is because large programs that attempt to do numerous things can be too complex for even the brightest of human minds to comprehend in their entirety, and thus it is extremely difficult to remove all bugs (i.e., errors) and make them as efficient and secure as possible.

Moreover, small, specialized programs have the advantage that they are easy to design to work well with each other when they are connected via pipes to form pipelines of commands. This makes it possible (and easy) to perform highly specific tasks that would be very tedious or impractical by any other means.

Programming is the creation of programs. It is performed by programmers, also frequently referred to as developers, who write the source code for a program using one or more programming languages and a text editor and often with a variety of more sophisticated tools as well, such as integrated development environments (IDEs), which operate in GUIs. Creating simple programs can be easy, interesting and educational, even for people with relatively little computer experience1.


________
1For a very simple tutorial on how to create and run a first program, see: How to Create a First C Program on Linux, The Linux Information Project, March 2006.






Created June 8, 2005. Updated May 30, 2006.
Copyright © 2005 The Linux Information Project. All Rights Reserved.