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 32 of 397Go testing Package: Unit Tests, Table-Driven Tests, and Benchmarks
Table-driven subtests, t.Parallel ownership, benchmark timers and allocations, cleanup order, golden files, and fuzzing with property checks.
Go Struct Embedding: Composition over Inheritance and Method Shadowing
Promotion by depth, ambiguous selectors, embedded pointers that panic, why there is no virtual dispatch, and JSON flattening that drops shadowed fields.
Go Type Switches: Syntax, Type Assertions, and Empty Interface Handling
Assertion forms that panic and those that do not, multi-type cases, typed nil interfaces, pointer-receiver method sets, and errors.As for wrapped errors.
Go Channels: Closing Channels, Range over Channels, and Idiomatic Patterns
Closing as a sender's statement, buffered values delivered after close, coordinating multiple senders, and the closed channel that spins a select loop.
Go Methods: Value vs Pointer Receivers, Method Sets, and Expressions
Value and pointer receivers, the method sets they produce, why map elements cannot call pointer methods, and method values that capture a copy.
Go Maps: Hash Map Internals, Concurrency Safety, and delete Operations
Nil map semantics, comparability rules for keys, concurrent access that kills the process, non-addressable values, and growth that never shrinks.
TypeScript Branded Types: Nominal Typing, Type Tags, and Validation
How a phantom property makes two strings incompatible, unique symbol brands, unit-typed numbers, and the places where a brand quietly disappears.
TypeScript Generic Parameter Defaults: Syntax, Precedence, and Inference
When a default applies and when inference wins, defaults that reference earlier parameters, and how a defaulted type parameter keeps a library change non-breaking.
TypeScript Ambient Declarations: .d.ts Files, declare, and declare global
How declare and .d.ts files describe runtime values, wildcard modules for assets, declare global with var, and module augmentation of third-party types.
TypeScript Namespaces vs Modules: Syntax, Declaration Merging, and Use Cases
How namespace merging works across files, why isolatedModules rejects it, and a migration path to ES modules with barrels and export * as.