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

Illustration of a C# code block with a custom attribute label and reflection arrows showing runtime metadata lookup
C#

How to Use C# Custom Attribute Classes

Learn how to define, apply, and read C# custom attribute classes, including AttributeUsage constraints and reflection-based retrieval.

C# attributesreflectionmetadatacode annotations
Illustration showing a C# attribute declaration on a code element with reflection retrieving metadata.
C#

C# Attribute Declaration Syntax and Usage

Learn the exact syntax for C# attribute declaration, including constructors, properties, targets, and retrieval via reflection.

C# attributesAttributeUsageCustom attributes.NET reflection
Diagram showing C# code elements tagged with metadata labels, illustrating how attributes attach to declarations.
C#

C# Attributes: Syntax, Usage, and Runtime Behavior

C# attributes from the ground up: what the metadata holds, AttributeUsage targets, custom attribute classes, and reading values at runtime with reflection.

C# AttributesReflectionCustom AttributesMetadata
C# params keyword illustrating multiple arguments being passed into a method
C#

C# Params Multiple Arguments

Learn how the C# params keyword lets methods accept multiple arguments without explicit arrays, including syntax, overload resolution, null handling, allocation tradeoffs, and when to use collections instead.

params keywordmethod overloadingargument passingC# syntax
A clean diagram showing a method call with multiple arguments flowing into a span buffer, representing the c# params span feature.
C#

Using C# params Span for Efficient Method Calls

Learn how to use C# params Span<T> to pass variable-length data with fewer heap allocations and better performance in high-throughput methods.

Span<T>paramsmemory efficiencyC# performance
Illustration of a C# method signature with params keyword expanding into multiple arguments, representing variable-length input.
C#

C# Params Array: Syntax and Usage

Learn how C# params array syntax works, when to use it, and how it affects method calls, overload resolution, and performance.

paramsC# methodsvariable argumentsarray parameters
A visual metaphor showing elements from multiple source collections being spread into a single target collection container.
C#

Using the C# Collection Expression Spread Operator

c# collection expression spread operator: Learn how the C# collection expression spread operator works, including syntax, target typing, allocation behavior, and commo...

C# 12Collection ExpressionsSpread OperatorArrays
A developer's code editor showing a C# collection expression initializing a list with square brackets and a spread operator.
C#

C# Collection Expression List Initialization

Learn how C# 12 collection expressions simplify list initialization with concise syntax, target typing, and the spread operator.

C# 12Collection ExpressionsList InitializationTarget Typing
C# collection expression syntax for array initialization showing square brackets and spread operator.
C#

C# Collection Expressions for Array Initialization

Learn how C# 12 collection expressions simplify array initialization, including target typing, spread elements, and common limitations.

C#Collection ExpressionsArray InitializationC# 12
Illustration of C# collection expression syntax showing multiple collection types being initialized.
C#

C# Collection Expression: Syntax and Examples

Learn how C# 12 collection expressions initialize arrays, lists, spans, and more with concise syntax and clear examples.

C# 12Collection ExpressionsArraysLists