Illegal vs. Unwanted States
The article distinguishes between illegal states, which a system must never enter, and unwanted states, which are permissible temporarily but should not persist. Unwanted states may arise due to external inputs or intentional design choices, such as overbooking flights or scheduling conflicting events. Systems must be able to represent and manage unwanted states to maintain flexibility and prevent them from becoming illegal states.
- ▪An illegal state is one a system must never enter, while an unwanted state is one that should not persist but can temporarily exist.
- ▪Systems often need to represent unwanted states due to lack of full control over inputs or to support useful workflows like intentional scheduling conflicts.
- ▪Overbooking on airlines is an example of a desired unwanted state that requires safeguards to prevent it from becoming an illegal state like overfilling a flight.
- ▪Unwanted states can be modeled using formal logic, such as the 'hot states' concept in the P specification language, to ensure they are resolved before causing violations.
- ▪Even if an unwanted state doesn't lead to data corruption, such as a network partition, it must still be resolved to maintain system functionality and reliability.
Opening excerpt (first ~120 words) tap to expand
April 28, 2026 Illegal vs Unwanted States Keep Unwanted States Representable An illegal state is a state we never want our system to be in. An unwanted state is a state we don't want to stay in. Many states that we wish were illegal are actually unwanted. Considering a calendaring software which stores calendar events as {user: {events: [event]}}, where each event has a start and end time. This allows one person to attend two events at the same time. We might consider this illegal and replace the data type with {user: {time: optional event}} which makes this impossible. However, a scheduling conflict isn't illegal, only unwanted! It is possible for a person to sign up for two overlapping events.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Buttondown.