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 363 of 397C# Dictionary Initialization: Syntax and Tradeoffs
Learn the main ways to initialize a Dictionary in C#: collection initializers, constructors, Add methods, and LINQ, with performance tradeoffs and common pitfalls.
C# Dictionary Declaration: Syntax and Initialization
Learn how to write a C# dictionary declaration with type parameters, collection initializers, initial capacity, custom comparers, and performance tradeoffs.
C# Dictionary Usage: Key Operations and Performance
Learn practical C# Dictionary operations: fast key-value lookups, missing-key handling, performance considerations, and thread-safe alternatives.
Remove Duplicates from a List in C#
Learn how to remove duplicates from a List<T> in C# using LINQ Distinct, HashSet, and custom comparers, with performance tradeoffs, order preservation, and in-place removal.
C# Array to List: Conversion Methods and Performance
Learn how to convert a C# array to a List with ToList() or the List<T> constructor, including performance, memory, and common pitfalls.
C# List to Array: Converting Collections with ToArray()
Convert a List<T> to an array in C# with ToArray() or CopyTo(), and understand the type, performance, and memory implications of each approach.
C# List Count vs Capacity: Key Differences
Understand the difference between Count and Capacity in C# List<T>, and see how setting Capacity can affect memory usage and performance.
C# List Count: Count Property vs Count() Method
Compare the List<T>.Count property and the LINQ Count() method: how they behave on List<T>, performance traits, and when to use Count() over Count.
C# List foreach: Syntax, Pitfalls, and Performance
Learn how to use foreach with List<T> in C#, including syntax, enumerator behavior, common pitfalls, and performance tradeoffs.
How to Reverse a List in C#: In-Place and LINQ
Reverse a C# List<T> with List.Reverse() or LINQ's Reverse(). Compare in-place mutation, deferred enumeration, and practical tradeoffs.