State

State is an important concept in computer science as well as our everyday lives.

What state do you live in? Sometimes states where people live are called provinces. In computer science, however, state is not a place you live. It’s something very different. State is stored information in a computer system at one instant in time. A computer that stores state is called a stateful system.

Your brain maintains state: what’s your name? where do you live? This type of information is stored in your brain to be remembered when needed. But what happens when you don’t remember? Computers have to solve the same problem.

If you have a laptop computer and close the lid, your laptop stores data about any software applications you have open. When you open your computer later, the past state of your laptop is retrieved and recreated by starting up any software you had open.

While we store our state information in our heads and pieces of paper, computers use hard drives and storage devices.

State also matters in computer systems that track transactions, not only times you buy something online but also messages that go back and forth within a computer. Messages and transactions often need to be connected to earlier and later messages. Capturing then storing data from a single moment in time, making a snapshot, makes it easy to keep track of messages and transactions.

Our conversations also have state. If I tell the sky is blue today, that’s not a message or detail you have to remember. But if I tell you soccer practice is after school at 3:30 this afternoon, and you want to play soccer, then somehow you have to remember my message.

Some message traffic does not require state. Messages exist solely as individual interactions. These messages are called stateless. They don’t require a history.

Software programming also uses state, for example, variables that store values used in one or more places in your code. Variables are called when your code needs to remember valuable information.

Learn More

State

/en.wikipedia.org/wiki/State_(computer_science)

What is State, Mutable State and Immutable State?

http://programmers.stackexchange.com/questions/235558/what-is-state-mutable-state-and-immutable-state

Definition of “state”

http://programmers.stackexchange.com/questions/150120/definition-of-state

State Machines – Basics of Computer Science

http://blog.markshead.com/869/state-machines-computer-science/


Author

  • Tim Slavin

    Tim is an award-winning writer and technologist who enjoys teaching tech to non-technical people. He has many years experience with web sites and applications in business, technical, and creative roles. He and his wife have two kids, now teenagers, who are mad about video games.

Also In The April 2017 Issue

We all use fonts yet rarely notice they are designed. Here are some interesting details to help you notice fonts.

This iPad app is a creative tool kids can use to explore and record what they learn in school.

Smart software design makes it easy for you to learn how to use it without help.

A new version of a fun Mario-like game that teaches kids coding has been released. Learn HTML and save kittens!

Mark is a designer who also knows a lot about how to use technology to create design.

Design is about solving problems, from donuts to race cars, how we eat to what to wear in cold weather.

Everyone know the difference between saying, “Let’s eat, grandma!” and “Let’s eat grandma!” Computers don't.

The user interface often determines whether or not people can easily use your software.

State is an important concept in computer science as well as our everyday lives.

Links from the bottom of all the April 2017 articles, collected in one place for you to print, share, or bookmark.

Interesting stories about computer science, software programming, and technology for April 2017.

Computers collect garbage the way humans do. Here's how they manage memory space.

Code reviews help programmers improve their code and learn more about the software they build.

Interested but not ready to subscribe? Sign-up for our free monthly email newsletter with curated site content and a new issue email announcement that we send every two months.

No, thanks!