3 ms·
I think a more useful way to put it is: State is a value in a system that may change over time. I would like to add “… that can be accessed from more than one
by jmull 2y ago
I think a more useful way to put it is:
State is a value in a system that may change over time.
I would like to add “… that can be accessed from more than one scope”, but that doesn’t quite match common usage of the term so might just cause confusion.
The distinction is useful, though, because values that change over time but only exist in one scope are easy to reason about and handle correctly, while ones shared across scopes can cause no end of problems if not well organized. Maybe we can use terms something like “trivial state” and “significant state”.
(And, yes, we’d also need to define “scope”. I think the intuitive/common meaning is enough to get the point across though.)