Browse by Topic

Popular

Latest

Latest C# Posts

Editorial illustration comparing C# var compile-time type inference with object base-type boxing, showing a typed variable next to a boxed value.
C#

c# var vs object: Static Type vs Base Type

c# var vs object: The real difference between var and object in C#: compile-time type inference, boxing behavior, and when each declaration is the right choice.

C#type inferenceboxingstatic typing
Illustration of C# var keyword inferring type from assigned expression
C#

C# var Type Inference: When to Use It and When to Avoid

Understand how C# var infers types at compile time, when implicit typing improves readability, and when explicit types are clearer.

C#type inferencevar keywordcompiler
Illustration of C# var keyword usage showing type inference from a variable declaration to a concrete type
C#

C# var Keyword Usage: Type Inference Explained

c# var keyword usage: Learn how C# var keyword usage works, when to use it for type inference, and how it affects readability and maintainability in real code.

C#Type InferenceAnonymous TypesLINQ
Diagram showing a variable being declared and then initialized with a value, highlighting the two-step process in C#.
C#

C# Variable Declaration vs Initialization

Understand the difference between declaring and initializing variables in C#, including default values, definite assignment, var inference, nullable reference types, and field initialization.

C#variable declarationvariable initializationnullability
Illustration of C# variable initialization showing default values and assignment rules.
C#

C# Variable Initialization: Rules and Defaults

Learn how C# variable initialization works: default field values, definite assignment for locals, var inference, ref/out rules, and common errors.

C#variable initializationdefault valuesdefinite assignment
Illustration of C# variable declaration showing type, name, and value assignment in a code editor.
C#

C# Variable Declaration: Syntax and Practical Usage

Learn how to declare variables in C# with explicit types, var, and nullable annotations, and understand how defaults, scope, and readability affect your choices.

variable declarationvar keywordnullable typesC# syntax