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

Editorial illustration of a C# generic method showing a type parameter flowing through a reusable function into multiple concrete types.
C#

C# Generic Method: Syntax, Constraints, and Behavior

Learn C# generic method syntax, constraints, type inference, runtime behavior, and common pitfalls.

generic methodstype parameterstype constraintstype safety
Illustration of a C# generic class with type parameters and constraints, showing reusable type-safe code.
C#

C# Generic Class: Type-Safe Reusable Code

Learn how to declare and use C# generic classes, apply type constraints, avoid common pitfalls, and understand runtime behavior.

C# genericstype parametersgeneric constraintstype safety
Illustration of C# generics concept with type parameters and safety.
C#

C# Generics: Type Safety Without Duplication

Learn how C# generics preserve types without duplication, from generic classes and methods to constraints, variance, and runtime tradeoffs.

generic classesgeneric methodstype constraintsvariance
Illustration comparing HashSet and SortedSet in C# showing unordered vs ordered collections.
C#

C# HashSet vs SortedSet: Choosing the Right Collection

Compare C# HashSet and SortedSet on performance, ordering, memory, and use cases so you can choose the right collection for your data operations.

HashSetSortedSetC# CollectionsPerformance
Comparison of C# Dictionary and SortedDictionary with a hash table on the left and a sorted tree on the right
C#

C# Dictionary vs SortedDictionary: Which to Use?

Compare C# Dictionary and SortedDictionary: ordering guarantees, lookup performance, memory behavior, and practical guidance for choosing between them.

DictionarySortedDictionaryC# CollectionsPerformance
Illustration of a C# SortedSet maintaining unique elements in ascending order with a custom comparer.
C#

C# SortedSet Usage: Ordered Set in .NET

Learn how to use C# SortedSet<T> for ordered, unique collections: creation, operations, custom comparers, and performance tradeoffs.

SortedSetC# Collections.NETData Structures
Diagram of a SortedDictionary showing sorted keys and value pairs in C#
C#

C# SortedDictionary Usage: Ordering and Performance

Learn how to use C# SortedDictionary for automatically ordered key-value storage, including custom comparers, performance tradeoffs, common pitfalls, and when to choose it over SortedList or Dictionary.

SortedDictionaryC# CollectionsOrderingComparer
Illustration of a sorted list in C# showing key-value pairs arranged in ascending order with an index pointer
C#

C# SortedList Usage: Sorting Key-Value Pairs Efficiently

c# sortedlist usage: Learn how to use SortedList<TKey, TValue> in C#: creation, insertion, lookup, iteration, and when to prefer it over SortedDictionary.

SortedListCollectionsC#Dictionaries
Flat illustration comparing a contiguous array of squares for List<T> with a chain of linked nodes for LinkedList<T> in C#.
C#

C# List vs LinkedList: When the Difference Matters

Compare C# List<T> and LinkedList<T> on storage, indexing, insertion cost, and memory behavior to choose the right collection for your workload.

List<T>LinkedList<T>Data StructuresPerformance
Diagram of a doubly linked list showing nodes with previous and next pointers, representing LinkedListNode in C#
C#

Working with LinkedListNode in C#

Learn how to use LinkedListNode<T> in C# to traverse, insert, and remove nodes in a LinkedList. Includes code examples, performance tradeoffs, and common pitfalls.

LinkedListLinkedListNodeC# CollectionsData Structures