All syntax guides
Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.
3,965 guides across 14 topics
Topics
Popular guides
Most readLatest guides
Page 25 of 397React useContext and useReducer: Scalable State Sharing Without Redux
Context transports state and useReducer names the transitions. Splitting the two contexts is what keeps dispatch-only components from re-rendering.
React useMemo vs useCallback: Memoization, React.memo, and When to Skip
Three tools for three different problems: a cached value, a stable function identity, a skipped subtree. How to tell which one the render cost needs.
React useRef: DOM Access, Mutable Values, and Ref Forwarding
A ref holds a value for the lifetime of the component without re-rendering. When to reach for the DOM, and how refs behave in React 19.
React useEffect: Dependency Arrays, Cleanup Functions, and Race Conditions
Effects synchronise with the outside world, and cleanup is what makes that safe. Dependency rules, abort controllers and the loops that follow from unstable deps.
React useState: Functional Updates, Automatic Batching, and Stale State
State is a snapshot, not a variable. Why three setCount calls add one, how React 18 batches after await, and how to update arrays and objects safely.
Rust Pin and Unpin: Memory Pinning, Self-Referential Structs, and Futures
Why a future must not move after polling starts, what Unpin opts out of, and how Box::pin, pin! and map_unchecked_mut express that guarantee.
Rust Unsafe: Raw Pointers, FFI Bindings, and Soundness Invariants
What unsafe actually unlocks, the five soundness contracts behind raw pointers, and the FFI rules for repr(C), CString and unwinding.
Rust Arrays and Slices: Fixed Arrays, &[T] Fat Pointers, and DSTs
An array carries its length in its type; a slice carries it in the pointer. The split_at_mut, chunks and TryFrom patterns that follow from that.
Rust Testing: Unit Tests, Integration Tests, and Cargo Doc Tests
Three test kinds with three different visibility rules, plus the commands, attributes and doc-test fences that make cargo test useful.
Rust Serde: JSON Serialization, Derive Macros, and Field Attributes
Serde attributes decide the wire format: rename strategies, defaults, flatten, enum tags and custom codecs, plus the number and ordering traps.