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 35 of 397TypeScript Generics: Type Constraints, extends Keyof, and Default Types
What T extends really constrains, how K extends keyof T keeps a return type tied to the key you pass, defaults on type parameters, and where NoInfer stops a second argument from widening inference.
TypeScript Type Narrowing: Type Guards, in Operator, and Discriminated Unions
Every guard TypeScript uses to narrow a union, what each one removes, and the three failures that keep narrowing from applying: typeof null, widened discriminants, and closures over mutable bindings.
Go Goroutines and Channels: Concurrency Patterns, Buffered Channels, and select
Go concurrency from the channel up: what an unbuffered send waits for, how select chooses, why goroutines leak, and the worker pool, timeout, and fan-in patterns that prevent it.
TypeScript Utility Types: Pick, Omit, Partial, and Record Explained
How Pick, Omit, Partial, and Record are built from mapped types: what each preserves, why Omit accepts a typo, how Partial distributes over unions, and the errors each raises.
TypeScript satisfies Operator: Syntax, vs Type Annotations, and as const
How the TypeScript 4.9 satisfies operator validates an expression without widening its inferred type, why per-property types survive, and how as const changes the result.
C# 12 Collection Expressions: Syntax, Spread Operator, and Performance
How C# 12 collection expressions convert to arrays, spans, lists, and builder-backed types, and where the spread element and target-type rules decide performance.
Java Record Patterns: Deconstruction, Nested Records, and switch Syntax
How Java 21 record patterns deconstruct record values, how nested patterns compose, and how guards, ordering, and exhaustiveness decide whether a pattern switch compiles.
Python 3.12 Generics: PEP 695 Syntax, Type Parameters, and TypeVar
How Python 3.12 PEP 695 type parameter syntax works: bracket declarations for classes, functions, and type aliases, bounds and constraints, inferred variance, lazy evaluation, and the runtime scope rules.
C# Primary Constructors: Syntax, Scope, and Pitfalls
How C# 12 primary constructors work on classes and structs, what the compiler generates, and the property, capture, and validation pitfalls that surprise teams.
Java 21 Virtual Threads: Syntax, Thread Pools, and Concurrency
How Java 21 virtual threads are created and scheduled, why they must never be pooled, and the pinning, ThreadLocal, and resource-limit problems that decide whether they help.