Program State - Program State

Program State

Similarly, a computer program stores data in variables, which represent storage locations in the computer's memory. The contents of these memory locations, at any given point in the program's execution, is called the program's state.

Imperative programming is a programming paradigm (way of designing a programming language) that describes computation in terms of the program state and statements that change the program state. In contrast, in declarative programming languages the program describes the desired results, and doesn't specify changes to the state directly.

A more specialized definition of state is used in some computer programs that operate serially (sequentially) on streams of data, such as parsers, firewalls, communication protocols and encryption programs. In some of these programs, the history of previous data inputs affects the processing of current input, that is the program can be modeled as a state machine. These programs are described as "stateful", and variables which contain values from the previous processing cycle are called the state. In other serial programs the output only depends on the current input; these are called "stateless".

Read more about this topic:  Program State

Famous quotes containing the words program and/or state:

    Utah is the only State that gives condemned men a choice between death by hanging or before a firing squad. Most prisoners prefer the firing squad, but one obstinate convict in 1912 elected to be hanged because “hanging is more expensive to the state.”
    State of Utah, U.S. public relief program (1935-1943)

    The present war having so long cut off all communication with Great-Britain, we are not able to make a fair estimate of the state of science in that country. The spirit in which she wages war is the only sample before our eyes, and that does not seem the legitimate offspring either of science or of civilization.
    Thomas Jefferson (1743–1826)