Program state

Program state

One of the key concepts in computer programming is the idea of state, essentially a snapshot of the measure of various conditions in the system. Most programming languages require a considerable amount of state information in order to operate properly - information which is generally hidden from the programmer. For a real-world example, consider a three-way light switch. An ordinary switch turns on a light when it's in the "up" position, but in a three-way switch the "up" position could be on or off, depending on the state or "configuration" of the other switch, which is likely out of view.

In fact, the state is often hidden from the computer's hardware as well, which normally has no idea that this piece of information determines program state, while that piece is a temporary variable and will soon be discarded. This is a serious problem, as the state information needs to be shared across multiple processors in parallel processing machines. Without knowing which state is important and which isn't, most languages force the programmer to add a considerable amount of extra code to indicate which data and parts of the code are important in this respect.

In computer science, imperative programming is opposed to declarative programming. Imperative programming is a programming paradigm that describes computation in terms of a program state and statements that change the program state.

References

See also

*Dataflow programming
*Imperative programming
*State (computer science)


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • State (disambiguation) — State or The State may refer to:Government* A sovereign political entity ** State ** Unitary state ** Nation state ** State (law), a well defined jurisdiction, with its own set of laws and courts. *State (country subdivision), a non sovereign… …   Wikipedia

  • State Historic Preservation Office — The State Historic Preservation Office (SHPO) was created in 1966 under Section 101 of the National Historic Preservation Act (NHPA).[1] The purposes of SHPO include surveying and recognizing historic properties, reviewing nominations for… …   Wikipedia

  • State (computer science) — In computer science and automata theory, a state is a unique configuration of information in a program or machine. It is a concept that occasionally extends into some forms of systems programming such as lexers and parsers. Whether the automaton… …   Wikipedia

  • Program status word — In computers, the program status word (PSW) is an area of memory or a hardware register which contains information about program state used by the operating system and the underlying hardware. It will normally include a pointer (address) to the… …   Wikipedia

  • State College Area School District — We are the future! Type and location Type Public Country United States …   Wikipedia

  • State police — are a type of sub national territorial police force, particularly in Australia and the United States. Some other countries have analogous police forces, such as the provincial police in some Canadian provinces, while in other places, the same… …   Wikipedia

  • State Guard Association of the United States — Abbreviation SGAUS Formation 1985 Legal status 501(c)(6) …   Wikipedia

  • State Space Agency of Ukraine — Державне космічне агентство України Established February 1992 (as National Space Agency of Ukraine) Headquarters Kiev Primar …   Wikipedia

  • State University of New York at New Paltz — Established 1828 Type Public President Donald P. Christian …   Wikipedia

  • State College Area High School — We are the Future! Location Westerly Parkway State College, Pennsylvania …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”