Pergunta

I'm rewatching Rich Hickey great talk "Simple Made Easy" And around min 35:40 when talking about state, mentions that State complects value and time, but I'm not sure I'm understanding this well.

Is it that because immutable data is always the same, being independent of time in the sense that it doesn't change over time?

I'd appreciate if someone with more understanding of this talk could clarify it.

Thank you.

Foi útil?

Solução

Wikipedia defines state as remembered information. It goes on to say that:

The set of states a system can occupy is known as its state space.

A stateful program (or system) is one in which something is remembered; however, with the immediate implication that a stateful system is in single state at a time out of multiple potential states. Thus, the usage of the word stateful suggests change or transition, in other words, to forget something old and/or to remember something new (for the same state).

Values, on the other hand, (once computed) are simply constants.

Rich is arguing that changes of state over time are at the root of complexity.

At ~31:51 he defines complect as the intertwining that introduces complexity (see image below):

So, essentially, by saying "state complects values and time", he suggests that state intertwines different values for the same thing over time in a way that results in an explosion of complexity.

image:

Licenciado em: CC-BY-SA com atribuição
scroll top