Pages

Topics

Tools

↑↓navigate↵openescclose

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

Latest guides

3D illustration of split state and dispatch context providers broadcasting reducer actions down a tree
React

React 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.

ReactState ManagementHooks
3D illustration of memoized dependency cache gates preserving referential equality down a component tree
React

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.

ReactPerformanceHooks
3D illustration of persistent mutable current-reference boxes connecting directly to DOM nodes
React

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.

ReactHooksDOM
3D illustration of a component lifecycle synchronised with AbortController fetch cancellation
React

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.

ReactHooksEffects
3D illustration of a React state update queue batching functional updater callbacks into one render
React

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.

ReactHooksState Management
3D illustration of a self-referential struct anchored in heap memory by a Pin lock
Rust

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.

RustAsyncMemory Safety
3D illustration of safe abstraction shields wrapping an isolated unsafe FFI boundary
Rust

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.

RustUnsafeFFI
3D illustration of a fixed stack array contrasted with a fat-pointer slice view over contiguous memory
Rust

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.

RustSlicesMemory Safety
3D illustration of Cargo test runner lanes validating unit, integration and doc examples
Rust

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.

RustTestingCargo
3D illustration of typed Rust structs serialising into structured JSON payloads through Serde attributes
Rust

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.

RustSerdeJSON