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 type assertion overrides casting ambiguous variable silhouettes into validated concrete type forms
TypeScript

TypeScript Type Assertions: as Syntax, Non-Null Assertion, and Safety

What an assertion actually promises, when the compiler rejects one, how as unknown as T bypasses the check, and where ! hides a lifecycle bug.

TypeScriptType SafetySyntax
3D illustration of bracket-indexed selectors plucking property type cubes from a nested object matrix
TypeScript

TypeScript Indexed Access Types: Syntax, Lookup Types, and Arrays

T[K] lookups on objects, arrays, and tuples, the undefined that optional properties add, and recursive path types built on indexed access.

TypeScriptGenericsType Queries
3D illustration of multiple call signature input slots channeling into a unified implementation engine
TypeScript

TypeScript Function Overloads: Syntax, Signatures, and Implementation

Overload resolution order, why the implementation signature is invisible to callers, the union-argument rejection, and when a generic signature is shorter.

TypeScriptFunctionsType System
3D illustration of tagged union data blocks branching into exhaustive switch cases with a secure never-type barrier
TypeScript

TypeScript Discriminated Unions: Exhaustiveness Checking and the never Type

Why the discriminant must be a literal, how never closes an exhaustive switch, and the duplicate-discriminant bug that lets a missing case compile.

TypeScriptType NarrowingPattern Matching
3D illustration of glowing numeric step counters and string literal blocks being organized into an immutable enum registry
TypeScript

TypeScript Enums: Numeric, String, const Enums, and Alternatives

How each enum form compiles, why numeric enums emit a reverse mapping, what const enums cost under per-file transpilation, and how an as const object replaces them.

TypeScriptType SystemEnums
3D illustration of a LIFO stack of deferred cleanup gears intercepting an emergency panic shockwave and recovering
Go

Go defer, panic, and recover: Control Flow, Resource Cleanup, and Pitfalls

Deferred calls run LIFO with arguments captured at the defer, recover only works in the panicking frame's deferred function, and defer inside a loop leaks until the function returns.

GoError HandlingControl Flow
3D illustration of a three-word slice header pointing into a contiguous memory array that expands when capacity is exceeded
Go

Go Slices vs Arrays: Slice Header, Length, Capacity, and append Mechanics

The three-word slice header, why append sometimes writes into another slice's memory, how the three-index slice prevents it, and where capacity hints and clearing matter.

GoData StructuresMemory
3D illustration of concurrent thread gates regulated by glowing mutex locks and a WaitGroup barrier counter
Go

Go sync Package: Mutex, RWMutex, WaitGroup, and sync.Once Explained

The primitives that make shared memory safe in Go, the reentrancy and copying traps that break them silently, and when sync.Once or sync.Cond beats a plain mutex.

GoConcurrencySynchronization
3D illustration of generic container brackets accepting diverse data types constrained by comparable union rules
Go

Go Generics: Type Parameters, Constraints, any, and comparable

Type parameter syntax, what the tilde in a constraint union actually admits, where inference stops, and why a struct containing a slice cannot satisfy comparable.

GoGenericsData Structures
3D illustration of Go goroutine branches propagating cancellation signals down a tree hierarchy with stopwatch timers
Go

Go Context: Cancellation, Deadlines, Timeouts, and Context Values

How context cancellation propagates down a call tree, why every CancelFunc must be called, how deadlines negotiate with parents, and what belongs in a context value.

GoConcurrencyBackend