The next two decades saw the development of a number of other major high-level imperative programming languages. FORTRAN was a compiled language that allowed named variables, complex expressions, subprograms, and many other features now common in imperative languages.
Declarative programming language list code#
FORTRAN, developed by John Backus at IBM starting in 1954, was the first major programming language to remove the obstacles presented by machine code in the creation of complex programs. In these languages, instructions were very simple, which made hardware implementation easier, but hindered the creation of complex programs. The earliest imperative languages were the machine languages of the original computers. These include the jump, called " goto" in many languages, and the subprogram, or procedure, call. Unconditional branching statements allow the execution sequence to be transferred to some other part of the program. Otherwise, the statements are skipped and the execution sequence continues from the statement following the block. Conditional branching statements allow a block of statements to be executed only if some condition is met. Loops can either execute the statements they contain a predefined number of times, or they can execute them repeatedly until some condition changes. Looping statements allow a sequence of statements to be executed multiple times. High-level imperative languages, in addition, permit the evaluation of complex expressions, which may consist of a combination of arithmetic operations and function evaluations, and the assignment of the resulting value to memory. Since the basic ideas of imperative programming are both conceptually familiar and directly embodied in the hardware, most computer languages are in the imperative style.Īssignment statements, in general, perform an operation on information located in memory and store the results in memory for later use.
Recipes and process checklists, while not computer programs, are also familiar concepts that are similar in style to imperative programming each step is an instruction, and the physical world holds the state. Higher-level imperative languages use variables and more complex statements, but still follow the same paradigm. From this low-level perspective, the program state is defined by the contents of memory, and the statements are instructions in the native machine language of the computer. The hardware implementation of almost all computers is imperative nearly all computer hardware is designed to execute machine code, which is native to the computer, written in the imperative style. Logical programming languages, like Prolog, are often thought of as defining "what" is to be computed, rather than "how" the computation is to take place, as an imperative programming language does. Functional programming languages, such as Haskell, are not a sequence of statements and have no global state as imperative languages do. Imperative programming languages stand in contrast to other types of languages, such as functional and logical programming languages. A commonly used synonym to imperative programming is procedural programming. In much the same way as the imperative mood in natural languages expresses commands to take action, imperative programs are a sequence of commands for the computer to perform.
In computer science, imperative programming, as contrasted with declarative programming, is a programming paradigm that describes computation as statements that change a program state.