Program state is the data and execution context present at a particular point while a program runs. It includes values such as variables, the system running the program, and its environment; accounting for it makes intended behavior harder to verify. section 1.2
State can be handled in different ways:
- Object-oriented programming splits state into objects and provides interfaces for controlled access. section 1.2
- Pure functional programming tries to minimize state rather than divide it into separate packages. section 1.2.1
A cake recipe
An instruction-based recipe changes the kitchen’s state after every step: “mix well” only makes sense when something is available to mix. A more functional description defines a cake batter, combines it with a chocolate mixture, and then defines the baked cake from that result, reducing dependence on hidden intermediate state. section 1.2.1






































