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

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
Diagram showing a C# class with an indexer exposing array-like access to internal collection.
C#

C# Indexers: Syntax, Usage, and Tradeoffs

Learn how to declare and use C# indexers with the `this` keyword, including syntax, overloads, read-only access, and practical tradeoffs.

C#IndexersObject-Oriented ProgrammingCollection Types
Illustration of a C# indexer concept showing an array-like access on a custom object.
C#

C# Indexer: Syntax, Usage, and Performance

Learn how to define and use C# indexers for array-like access in custom collections, including syntax, overloads, and performance considerations.

indexerC# collectionsproperty accessoverloading
Illustration of a C# conversion operator converting a temperature struct to a double value
C#

C# User Defined Conversion Operator Explained

Understand C# user-defined conversion operators: syntax, implicit vs explicit choices, rules, and practical examples for custom type conversions.

C#Conversion OperatorsType ConversionOperator Overloading
A diagram showing a C# explicit cast between two custom type boxes, with a visible cast operator symbol.
C#

C# Explicit Operator: Defining Custom Type Conversions

Learn how to define explicit conversion operators in C# with syntax, practical examples, and guidance on when to use them safely.

C#Conversion OperatorsOperator OverloadingType Conversion
Abstract illustration of two shapes connected by an arrow, symbolizing an implicit conversion in C#.
C#

Using C# Implicit Operators to Convert Types Cleanly

Learn how C# implicit operators create clean, lossless conversions between related types, where they are a good fit, and when to prefer explicit operators or named methods.

C# operatorstype conversionimplicit conversionvalue objects