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

C# property pattern diagram showing an object being matched against property conditions with arrows pointing to match branches
C#

C# Property Pattern with Examples

Learn how to use the C# property pattern to match objects based on their properties, with practical examples and common pitfalls.

Pattern MatchingC# SyntaxProperty ValidationSwitch Expressions
Illustration of a switch expression branching on constant values in C#
C#

Using the C# Constant Pattern in Switch Expressions

Learn how the C# constant pattern works in switch expressions and statements, including syntax, matching rules, and practical use cases.

C# pattern matchingswitch expressionsconstant patterntype patterns
A flowchart-like visual showing an object being matched to multiple type branches in C#.
C#

C# Type Pattern: Syntax and Usage

Learn how to use the C# type pattern with is expressions and switch statements for type testing and property matching.

type patternspattern matchingC# switchis expression
C# pattern matching concept showing a switch expression branching to type and property patterns on a clean background.
C#

C# Pattern Matching: Syntax and Practical Use

c# pattern matching: Explore C# pattern matching with practical examples: type, property, and positional patterns, switch expressions, and when to use them effectively.

C#pattern matchingswitch expressionstype patterns
Illustration of a C# custom iterator concept, showing a sequence being generated lazily with a state machine and yield return.
C#

Creating a C# Custom Iterator with yield

c# custom iterator: Learn how to build a C# custom iterator using yield return, when it's useful, and how it affects performance and memory.

yield returnIEnumerable<T>state machinelazy evaluation
Diagram showing IEnumerable as an iterable contract and IEnumerator as a stateful cursor advancing through a sequence in C#.
C#

IEnumerable vs IEnumerator in C#: Key Differences

Understand how IEnumerable and IEnumerator work in C#, how foreach uses both interfaces, and when to implement each interface directly.

C#IEnumerableIEnumeratorLINQ
Diagram showing a C# iterator method with yield return producing a sequence of values on demand.
C#

C# Iterator: How yield return Works

Understand how C# iterators work with yield return, including deferred execution, the generated state machine, and practical performance considerations.

yield returnIEnumerabledeferred executionstate machine
Diagram comparing C# property and indexer syntax with a class showing both access patterns.
C#

C# Property vs Indexer: Key Differences and Usage

Understand the differences between C# properties and indexers, including syntax, use cases, and when to choose each for clean, maintainable code.

C# propertiesC# indexersC# syntaxobject-oriented programming
Diagram showing a C# indexer with two parameters mapping to a value in a grid
C#

C# Multiple Parameter Indexer: Syntax and Use

C# indexers can take multiple parameters to expose natural syntax such as `matrix[row, column]`. This article covers declaration syntax, overloads, composite keys, and common pitfalls.

IndexersC# SyntaxObject-Oriented ProgrammingCollection Access
Diagram showing a C# indexer with get and set accessors accessing an array element
C#

C# Indexer get and set: Syntax and Usage

Learn how to implement C# indexers with get and set accessors, including syntax, validation logic, overloading, and performance considerations.

C# indexersget set accessorsindexer syntaxcustom collections