Stateful - 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:  Stateful

Famous quotes containing the words program and/or state:

    Wags try to invent new stories to tell about the legislature, and end by telling the old one about the senator who explained his unaccustomed possession of a large roll of bills by saying that someone pushed it over the transom while he slept. The expression “It came over the transom,” to explain any unusual good fortune, is part of local folklore.
    —For the State of Montana, U.S. public relief program (1935-1943)

    If a hermit lives in a state of ecstasy, his lack of comfort becomes the height of comfort. He must relinquish it.
    Jean Cocteau (1889–1963)