State

Why Trust Techopedia

What Does State Mean?

In computer science, the state of a program is defined as its condition regarding stored inputs. The term “state” here is used similarly to how it is used in science — whereas the state of an object, for instance, as a gas, liquid or solid, shows its current physical makeup, the state of a computer program shows its current values or contents.

Advertisements

Techopedia Explains State

The stored inputs in a computer program are stored as variables or constants. In analyzing the state of a program, developers may go through and look at values that are stored in these inputs. As the program is executed, its state may change — variables can change and the values that are stored in memory can also change. For example, a control variable such as a variable used in a loop changes the state of the program at each iteration. Looking at the state of a program can be considered a testing method or a way of analyzing the code base.

Developers also talk about different types of states, for example, contrasting two complementary states that are not contradictory to one another or contrasting two different states resulting from different operations.

Advertisements

Related Terms

Margaret Rouse
Technology Specialist
Margaret Rouse
Technology Specialist

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.