Skip to content

Latest commit

 

History

History

imperative

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Imperative Programming

Programming paradigm that uses statements that change a program's state. In much the same way that the imperative mood in natural languages expresses commands, an imperative program consists of commands for the computer to perform.

Imperative pgoramming focuses on describing how a program operates.

The term is often used in contrast to declarative programming, which focuses on what the program should accomplish withput specifying how the program should achieve the result.

Procedural Programing

Procedural programming is a type of imperative programming in which the program is built from one or more procedures, also termed subroutines or functions.

The terms are often used as synonyms, but the use of procedures has a dramatic effect on how imperative programs appear and how they are constructed. State changes are localized to procedures or restricted to explicit arguments and returns from procedures, in a form of Structured Programming.

Procedural programming could be considered a step toward declarative programming. A programmer can often tell by simply looking at the names, arguements, and return types of procedures (and related comments), what a particular procedure is supposed to do, without necessarily looking at the details of how it achieves its result.

At the same time, a complete program is still imperative since it fixes the statements to be executed and their order of execution to a large extent.