liveBook · Manning

Determinism

As explained in Data-Oriented Programming: Reduce software complexity

Determinism is the property that the same causes produce the same effects, such as the same function arguments producing the same return value.

Deterministic behavior means that the same causes produce the same effects. In programming, treat function arguments as causes and return values as effects: identical arguments should yield identical results. This connection matters when debugging because predictable behavior makes failures reproducible. section 15.1

State breaks the prediction

A function can return different values for the same arguments when program state changes. Rather than pretending applications can eliminate state, isolate it: let a SystemState module handle state while other modules operate on immutable data. Within those modules, the same arguments should consistently produce the same return value. section 15.1

How Data-Oriented Programming: Reduce software complexity covers it

How deep it goes
Defines causes and effects, then stops short of side effects and isolates changing program state.
Examples
Uses elevator predictability and functions receiving identical arguments as concrete examples.
What you can do after
Evaluate whether immutable-data modules return consistent values for identical arguments during debugging.
How it connects
Connects determinism with debugging, program state, immutable data, side effects, and data-oriented programming.

Also explained in

Compare how 10 books explain determinism →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data-Oriented Programming: Reduce software complexity. The section links point to the parts of the book it draws on.