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 33 of 397TypeScript 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.