State
State is information or a configuration describing the condition of a system, entity, or computation at a particular time and potentially influencing subsequent behavior or decisions.
React Quickly, Second Edition
Global state is application data maintained at a scope accessible to multiple components or parts of an application.
- How it is used
- Coordinates changing application data across components so interactions update the UI.
- How deep it goes
- Works through state placement, useState updates, and prop-based sharing; defers Context and more complex state techniques.
- Examples
- Uses a click counter, clock, current-page menu, and multicomponent task list to show local and shared state.
- What you can do after
- Build it from scratch: place shared state in a parent and pass values and update functions to task and filter components.
Build a Frontend Web Framework (From Scratch)
The data representing the current conditions and values of a running application.
- How it is used
- Determines the current view and supplies the values changed in response to user interaction.
- How deep it goes
- Develops state from a to-do array into framework-managed values and per-component initialization, updates, and patching.
- Examples
- Uses a to-do list, a clickable counter, and a list of counters whose internal values challenge reconciliation.
- What you can do after
- Build it from scratch: define initial component state and update it through a method that patches the view.
Read how Build a Frontend Web Framework (From Scratch) explains state →
Natural Language Processing in Action, Second Edition
A hidden state vector is the numerical state carried through a recurrent network to summarize information from earlier sequence inputs.
- How it is used
- Carries information between successive tokens so a recurrent network can update its representation and produce outputs as it reads.
- How deep it goes
- Works through state initialization, a PyTorch forward pass, prefix-level inspection, and backpropagation through time.
- Examples
- Uses a PyTorch RNN and a surname classifier whose hidden vectors and nationality predictions change across character prefixes.
- What you can do after
- Build it from scratch in PyTorch and inspect how its hidden vector changes during character-by-character classification.
Read how Natural Language Processing in Action, Second Edition explains state →
Hacking Cryptography
The internal state of an LFSR is the mutable sequence of register bits that determines its subsequent output and evolution.
- How it is used
- Frames prediction, cloning, and keystream-recovery attacks as consequences of exposed mutable cryptographic data.
- How deep it goes
- Explains LFSR state transitions in executable detail and connects state recovery to concrete cloning attacks.
- Examples
- Uses LCG and MT19937 cloning, LFSR keystream encryption, and secret-prefix MAC length extension.
- What you can do after
- Evaluate/understand how observable or recoverable state enables prediction, cloning, and continuation attacks.
Functional Programming in Scala, Second Edition
State is a parameterized state-transition abstraction that represents computations producing a value while transforming an underlying state.
- How it is used
- Models stateful APIs as pure, composable computations that explicitly return their next state.
- How deep it goes
- Defines State as S => (A, S) and develops composition, get/set/modify, and state-machine simulation.
- Examples
- Uses a functional RNG and a coin-operated candy dispenser driven by Coin and Turn inputs.
- What you can do after
- Build it from scratch as a generic State type and compose state-machine transitions with standard combinators.
Read how Functional Programming in Scala, Second Edition explains state →
Rust Servers, Services, and Apps
Application state is the data representing the current condition of an application's configuration, behavior, or resources.
- How it is used
- Supplies shared course data or a database pool to Actix request handlers.
- How deep it goes
- Builds and tests in-memory state, then replaces its course collection with an injected Postgres pool.
- Examples
- Uses a health-check visit counter, course POST and GET handlers, and tests that construct handler state.
- What you can do after
- Build it from scratch with Actix `web::Data`, then configure handlers to use shared collections or a sqlx pool.
Build Python Web Apps with Streamlit
A graph state is the structured mutable data associated with a graph execution, including the messages for a conversation thread.
- How it is used
- Carries conversation messages and other named values between nodes in a LangGraph chatbot.
- How deep it goes
- Explains typed fields, node updates, thread persistence, and state retrieval without detailing checkpointer internals.
- Examples
- Uses a one-node LLM chatbot, a system-message context field, and a conversation-history display.
- What you can do after
- Build it from scratch in LangGraph with a state schema, node updates, and saved conversation threads.
Read how Build Python Web Apps with Streamlit explains state →
Sutskever's List
A hidden state is the recurrent representation carried between sequence-processing steps and updated from prior state and current input.
- How it is used
- Carries learned context between sequence steps or graph-message rounds so later predictions can use earlier information.
- How deep it goes
- Explains stepwise recurrence, long-range memory failure, and LSTM state distinctions without deriving update equations.
- Examples
- Uses character prediction, an earlier mention of France, and molecular atoms exchanging messages.
- What you can do after
- Evaluate/understand it as useful carried context, while recognizing long-range forgetting and fixed-vector compression as distinct limitations.
Inside Deep Learning: Math, Algorithms, Models
The recurrent state vector carried by an RNN across time steps, used here to store sequence information and initialize decoding.
- How it is used
- Uses a recurrent tensor to summarize sequence history and initialize sequence-to-sequence decoding.
- How deep it goes
- Explains state updates, zero initialization, layer passing, decoder transfer, and gradient difficulties before deferring detailed gated equations.
- Examples
- Uses weather vectors, a zero-initialized three-step unrolling, a recurrent update loop, and encoder-decoder initialization.
- What you can do after
- Build a recurrent update loop and evaluate how its final state represents a sequence or initializes a decoder.
Read how Inside Deep Learning: Math, Algorithms, Models explains state →
Get Programming: Learn to code with Python
- How it is used
- Uses an object’s current contents to explain why later list operations see earlier changes.
- How deep it goes
- Explains in-place change, rebinding, aliases, and copies, including their effect on object identity.
- Examples
- Uses grocery lists, indexed color replacements, artist-list copies, and a changing menu.
- What you can do after
- Diagnose/debug with it when a list changes unexpectedly, and choose an in-place update or an independent copy.
Read how Get Programming: Learn to code with Python explains state →
Functional Design and Architecture: Examples in Haskell
State is the information representing the current condition of a computation or system and that may affect subsequent behavior.
- How it is used
- Organizes stateful functional applications by separating pure business logic from effectful interpreter state.
- How deep it goes
- Classifies lifetimes and purity, then develops argument passing, state monads, mutable references, and concurrency-oriented primitives.
- Examples
- Uses controller runtimes, a sandwich interpreter, spaceship rotation, mocked hardware counters, and a Brainfuck runtime.
- What you can do after
- Evaluate/understand where state should live and choose pure argument passing or controlled mutable interpreter state.
Read how Functional Design and Architecture: Examples in Haskell explains state →
Statistics Every Programmer Needs
A state is a distinct condition or status that a process or system can occupy at a particular point in time.
- How it is used
- Defines the possible conditions used to forecast a system’s next condition or distribution of conditions.
- How deep it goes
- Defines exhaustive, exclusive states and works through transition-matrix forecasts, including repeated multiplication and equilibrium.
- Examples
- Uses running versus non-running engine conditions and four cellular-carrier states, with NumPy market-share forecasts.
- What you can do after
- Apply it via NumPy to represent states, multiply a probability vector by a transition matrix, and interpret the forecast.
Deep Learning with Python, Third Edition
A hidden-state tensor carried by a recurrent network that summarizes previous inputs and influences future outputs.
- How it is used
- Carries information from earlier sequence elements into an RNN's current step and supports token-by-token generation.
- How deep it goes
- Works through a timestep loop and NumPy implementation, then shows explicit GRU state handoff without deriving recurrent dynamics mathematically.
- Examples
- Uses a NumPy RNN loop, character-level text generation, and an encoder-initialized translation decoder.
- What you can do after
- Build it from scratch in a toy NumPy loop and apply it via Keras GRU inputs and outputs for generation.
Read how Deep Learning with Python, Third Edition explains state →
Build AI-Enhanced Web Apps
Mutable information representing the current conditions and accumulated information of an application or workflow.
- How it is used
- Coordinates visible chat interactions with the conversation data and context used by server-side AI actions.
- How deep it goes
- Works through separate state shapes, a provider, server actions, client hooks, and persistence hooks rather than React state internals.
- Examples
- Uses a profile-and-settings provider and a streaming chat with separate conversation history and rendered messages.
- What you can do after
- Apply it via the Vercel AI SDK to coordinate server-side conversation history with client-side chat updates.
Modern C, Third Edition
Hidden state is implementation or library state that affects program behavior without being directly represented by ordinary program values.
- How it is used
- Identifies execution dependencies that affect behavior beyond the values apparent in an expression or function call.
- How deep it goes
- Defines hidden state within the abstract state machine and works through aliasing and floating-point dependencies, without specifying lock or atomic internals.
- Examples
- Uses mutex lock state, one-time initialization, atomic flags, pointer aliasing, and floating-point pragmas as concrete cases.
- What you can do after
- Evaluate/understand whether a function’s apparent inputs capture its state dependencies before assigning `[[unsequenced]]`.
Idiomatic Rust
Global data is program state stored in a globally accessible location rather than passed through local interfaces.
- How it is used
- Handles data needed beyond local interfaces while weighing the convenience of global access against its design and safety costs.
- How deep it goes
- Explains static initialization limits, lazy initialization, and library-level alternatives, with focused Rust examples rather than a full state-management framework.
- Examples
- Uses a rejected static vector of names, a lazy_static version, and a builder-created library context.
- What you can do after
- Evaluate/understand when to avoid global state and when to use lazy initialization or pass an explicit context instead.
React in Depth
State is the data maintained by a component that represents its current condition and can cause updated rendering when changed.
- How it is used
- Organizes changing UI, form, application, and view-selection data as users interact with a React application.
- How deep it goes
- Works through hook typing, inspection, and a UX-state integration; stops short of explaining state-update internals.
- Examples
- Uses an appointment response, an empty tag list, a dark-mode inspector, and list/detail view selection.
- What you can do after
- Apply it via typed useState for local values and Zustand for view selection alongside TanStack Query.
Akka in Action, Second Edition
State is the mutable or persistent information that represents an actor's current condition and influences its behavior.
- How it is used
- Uses state to model wallet balances and make command decisions sequentially within actors.
- How deep it goes
- Explains behavior-based updates, then develops event-sourced State with command and event handlers, persistence, snapshots, and restart settings.
- Examples
- Demonstrates bounded wallet totals, a cargo container State list, and a betting-wallet balance with reservation events.
- What you can do after
- Apply it via Akka Typed and Akka Persistence to implement stateful, durable wallet entities that accept or reject fund requests.
D3.js in Action, Third Edition
React state is component-owned data whose updates can trigger a component to render again.
- How it is used
- Coordinates loading, fetched chart data, and interactive filter selection so visualizations render and update.
- How deep it goes
- Defines useState variables and demonstrates asynchronous and click-driven updates, without detailing React rendering internals.
- Examples
- Demonstrates loading flags, fetched chart arrays, active ranking filters, and a dashboard that explores internet blackouts.
- What you can do after
- Apply it via React useState to load data, control conditional output, and update visualizations from user selections.
AI Agents and Applications
State is the structured information representing a workflow's progress, intermediate results, failures, and contextual values across processing steps.
- How it is used
- Carries intermediate data and routing values through a multi-step research workflow.
- How deep it goes
- Works through typed fields, node updates, initialization, and conditional routing, without detailing state storage internals.
- Examples
- Uses a web research assistant’s initial state, search results, relevance checks, and iteration count.
- What you can do after
- Build it from scratch with LangGraph StateGraph, typed state, node updates, and state-based routing.
Build a Robo-Advisor with Python (From Scratch)
A state is a representation of the relevant current variables of an environment that determine an agent's possible decisions.
- How it is used
- Represents an investor’s current wealth and time when choosing stock-versus-bond allocations.
- How deep it goes
- Defines states, discretizes wealth-time nodes, and uses them in transition probabilities and backward induction.
- Examples
- Uses a wealth-time grid, a node just below a $2 million goal, and stock-bond allocation choices.
- What you can do after
- Build it from scratch by creating discrete wealth-time grids and evaluating state transitions for allocation decisions.
Read how Build a Robo-Advisor with Python (From Scratch) explains state →
Modern C
Hidden state is execution state that affects program behavior but is not directly represented as an ordinary program value.
- How it is used
- Frames C execution as changes to values, execution points, stored data, intermediate values, and hidden state.
- How deep it goes
- Defines state composition and effects, then works through pointer aliasing and concurrency without fully resolving multithreaded observability.
- Examples
- Uses pointer mutation, aliased arguments, function calls, void expressions, recursive calls, locks, once_flag, and atomic_flag.
- What you can do after
- Diagnose/debug state changes by tracking object locations, pointer aliasing, execution points, side effects, and synchronization state.
Apache Kafka in Action
Current state is the complete information representing the present condition of a system or entity.
- How it is used
- Represents an object’s complete condition in a Kafka message or a service’s current view derived from history.
- How deep it goes
- Defines complete state messages and explains reconstruction costs, but defers log-compaction details.
- Examples
- Uses product price and stock messages, a machine’s latest status, and a customer’s account balance.
- What you can do after
- Evaluate/understand it: distinguish complete state from changes and assess when reconstructing current state from Kafka history is costly.
Refactoring to Rust
State is data representing the current condition of a component or application.
- How it is used
- Tracks paginated article data and fetch status in React and Yew UI components.
- How deep it goes
- Defines state through working React and Yew examples, including initialization, updates, and rendering.
- Examples
- Uses a paginated article list and Yew fetch states for fetching, success, and failure.
- What you can do after
- Apply state through React hooks or Yew component methods to update and render a paginated article feed.
The Well-Grounded Rubyist, Fourth Edition
State is the information and data associated with an object that represents its current properties or condition.
- How it is used
- Represents an object’s current information and supports distinguishing, updating, and querying individual instances.
- How deep it goes
- Explains instance-variable storage, initialization, access methods, persistence, and state removal in favor of pure functions.
- Examples
- Uses Person and Ticket objects, then contrasts a stateful Grade and ReportCard design with a stateless grading system.
- What you can do after
- Build it from scratch by defining, initializing, retrieving, modifying, or deliberately removing object state.
Read how The Well-Grounded Rubyist, Fourth Edition explains state →
Platform Engineering on Kubernetes
Application state is the data that represents an application's current condition and must persist across requests or component executions.
- How it is used
- Uses state management to determine whether Kubernetes services can scale replicas while preserving consistent application behavior.
- How deep it goes
- Explains external stores, in-memory limitations, connection pools, and sessions, but stops short of implementing session replication.
- Examples
- Demonstrates Conference Agenda replicas backed by Redis and contrasts them with agenda data kept in pod memory.
- What you can do after
- Diagnose scaling problems by comparing replica behavior, external persistence, database connections, and in-memory data.
Read how Platform Engineering on Kubernetes explains state →
Automating API Delivery
The actual state is the configuration state that an API system currently has in operation.
- How it is used
- Uses actual state to monitor and control the configuration currently deployed in API gateway environments.
- How deep it goes
- Explains state reconciliation, drift detection, automatic correction, versioning, review, and rollback, but not implementation internals.
- Examples
- Demonstrates API gateway UI changes, environment repositories, Git pull requests, deployment pipelines, and reconciliation agents.
- What you can do after
- Operate/configure API gateway deployments by detecting drift and restoring actual configuration from reviewed Git declarations.
Deep Learning with R, Third Edition
A neural-network state is an internal representation that carries information from earlier sequence elements to later processing steps.
- How it is used
- Carries sequence history through recurrent processing and supports autoregressive prediction one token at a time.
- How deep it goes
- Explains initialization, recurrent updates, explicit propagation, and sequence resets, without deriving training dynamics or long-term memory limitations.
- Examples
- Uses a toy RNN loop, an R implementation, and Shakespeare character generation with a prompted GRU state.
- What you can do after
- Build it from scratch with an RNN loop and propagate an explicit GRU state during token-by-token generation.
Read how Deep Learning with R, Third Edition explains state →
Grokking AI Applications
The stored sequence of prior user inputs and model outputs that represents an ongoing conversation.
- How it is used
- Maintains conversational context by storing and forwarding prior user messages and model outputs across requests.
- How deep it goes
- Defines the storage-and-forward operation but defers its implementation details.
- Examples
- Uses an ongoing chat where subsequent requests receive earlier user messages and model outputs.
- What you can do after
- Operate applications that preserve conversational context across requests.
Kafka Streams in Action, Second Edition
State is retained information representing the accumulated condition or progress of a stream-processing computation.
- How it is used
- Tracks information or progress across related events in Kafka Streams.
- How deep it goes
- Defines state through keyed retrieval, updating, initialization, and reduction, while pointing toward state stores, joins, and timestamps.
- Examples
- Uses widget counting and per-player poker-score accumulation to demonstrate keyed state and reduction.
- What you can do after
- Apply it via Kafka Streams to aggregate keyed events and retain results across an unbounded stream.
Read how Kafka Streams in Action, Second Edition explains state →
Causal AI
A state is the representation of an agent's situation that determines the relevant decision and future dynamics in a sequential decision process.
- How it is used
- Represents the agent’s current decision context within a Markov decision process.
- How deep it goes
- Defines states, formalizes their transition kernel, and connects Markov assumptions to causal DAG reasoning.
- Examples
- Uses reachable grid cells, obstacles, terminal cells, latent states, and observed states as concrete representations.
- What you can do after
- Evaluate/understand sequential decision models and formulate causal queries involving observed or unobserved states.
Grokking AI Algorithms, Second Edition
A state is a configuration of the environment at a particular point in an agent's interaction with it.
- How it is used
- Represents candidate solutions for evolutionary search and environment configurations for reinforcement-learning interaction.
- How deep it goes
- Defines fixed representations and traces state updates through actions, rewards, bounds, and goal checks.
- Examples
- Uses binary-encoded knapsack selections and a parking-lot simulator with coordinates, collisions, rewards, and paths.
- What you can do after
- Build it from scratch, represent candidate solutions or implement simulator state access and updates.
Read how Grokking AI Algorithms, Second Edition explains state →
Road to Kubernetes
State is the persistent data or condition that determines how software behaves across operations or restarts.
- How it is used
- Frames deployment decisions around whether application data must survive destroyed machines or containers.
- How deep it goes
- Demonstrates persistence through database backups, Docker volumes, environment variables, and Ansible desired-state reporting.
- Examples
- Uses database data, recreated Python and Node.js environments, an interactive NGINX container, Docker volumes, and Ansible tasks.
- What you can do after
- Operate/configure containers with volumes and environment variables, and distinguish reproducible stateless workloads from persistent stateful services.
Code Like a Pro in Rust
Global state is data accessible across an application's execution context rather than owned by a single local scope.
- How it is used
- Handles shared fixtures and global test state under Cargo's parallel unit-test execution.
- How deep it goes
- Explains unsafe mutable statics, atomics, Arc initialization limits, lazy_static, and mutex-based serialization.
- Examples
- Uses a mutable static counter, AtomicI32, Arc, lazy_static, and Mutex-protected tests as implementation examples.
- What you can do after
- Operate shared test state safely with atomics, lazy_static initialization, or mutex guards.
Transformers in Action
A state is a representation of the situation in a decision process that provides the information relevant to selecting an action.
- How it is used
- Represents decision situations for selecting actions and preserves sequence context during recurrent processing.
- How deep it goes
- Defines states and illustrates recurrent updates, without descending into implementation details of state representations.
- Examples
- Uses a dog navigating obstacles and an encoder-decoder translation workflow to make states concrete.
- What you can do after
- Evaluate how current situations guide agent actions and how recurrent processing carries context across sequence items.
Amazon Web Services in Action, Third Edition: An in-depth guide to AWS
A state is a distinct condition of a process in a state machine that determines which transitions are possible.
- How it is used
- Models completed process stages so fault-tolerant applications can control transitions and recover from failures.
- How deep it goes
- Defines finite-state behavior and demonstrates DynamoDB checks, updates, and SQS messaging, without covering exhaustive workflow states.
- Examples
- Uses Created, Uploaded, and Processed image states plus EC2 stopping and termination as operational state examples.
- What you can do after
- Build it from scratch by defining permitted states, validating transitions, persisting updates, and retrying idempotent operations.
Read how Amazon Web Services in Action, Third Edition: An in-depth guide to AWS explains state →
Learn Haskell by Example
Program state is the collection of values and conditions describing a computation at a particular point during its execution.
- How it is used
- Frames state as the source of hidden complexity that complicates reasoning about program correctness.
- How deep it goes
- Defines state through variables and execution context, then explains its dependencies using a concrete recipe analogy.
- Examples
- Uses variables, execution environments, and chocolate-cake preparation to make state and state dependencies concrete.
- What you can do after
- Evaluate how changing data and execution context affect program behavior, and recognize why minimizing state can simplify reasoning.
LLMs in Production
A hidden state is an internal representation produced by a sequence model that summarizes information processed up to a position or layer.
- How it is used
- Uses hidden state to carry sequence context into the next prediction or classification decision.
- How deep it goes
- Defines probabilistic and neural state, demonstrates implementations, and discusses vanishing and exploding gradients in recurrent processing.
- Examples
- Uses next-token generation, sentiment classification, tokenized documents, and RNN or LSTM implementations as concrete examples.
- What you can do after
- Build it from scratch using a Markov generator or inspect recurrent implementations that maintain state across tokens.
Essential TypeScript 5, Third Edition
Component state is data maintained by a user-interface component whose changes can trigger a re-render.
- How it is used
- Manages component-local values that change through user interaction and cause React content updates.
- How deep it goes
- Explains typed class state, setState, and useState with a quantity example, but does not descend into React lifecycle internals.
- Examples
- Uses a product item whose select control changes a numeric quantity before an Add To Cart callback runs.
- What you can do after
- Apply state via typed class components with setState or functional components with useState and an updater function.
Read how Essential TypeScript 5, Third Edition explains state →
Related concepts
- immutable collectioncontrasts with · An immutable collection is a collection whose membership and contents cannot be changed after creation.
- listincludes · A list is an ordered collection of elements arranged in a sequence.
- reduction operationused by · A reduction operation combines multiple input values or partial results according to a combining rule to produce fewer results, often a single aggregate.
- recurrent neural networkpart of · A recurrent neural network is a neural network that processes sequences by updating an internal state across successive inputs, allowing earlier inputs to influence later computations.
- accessor methodused by · An accessor method or function provides access to an object's property or state by retrieving its value, assigning a value, or defining behavior for such access.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.






































