Browse by Topic

Popular

Latest

Latest Posts

Abstract representation of the C# this keyword pointing to the current instance of an object in a class diagram.
C#

C# This Keyword: Usage and Common Pitfalls

Understand the C# this keyword: use it in constructors and extension methods, resolve name collisions, and see where it is optional, required, or forbidden.

C#this keywordobject-oriented programmingextension methods
Illustration of a static class symbol shared across multiple object instances, representing C# static members.
C#

C# Static Members Explained with Practical Examples

Understand C# static members: how static fields, methods, properties, constructors, and classes behave, when to use them, and how they differ from instance members.

static classstatic methodsstatic fieldsC# programming
Diagram showing two object instances of a class, each with its own set of instance fields, and a shared static field on the class.
C#

C# Instance Members Explained

Learn how C# instance members define per-object state and behavior through fields, properties, methods, constructors, and the this keyword.

csharpoopinstance-membersfields
Diagram of C# class with labeled member variables showing instance, static, and readonly fields.
C#

C# Member Variables Explained with Examples

Understand C# member variables: field syntax, initialization, static vs instance, readonly and const, and when properties are the better choice.

C# FieldsInstance MembersStatic MembersReadonly and Const
Abstract representation of a C# class with fields highlighted, showing structured data storage.
C#

C# Field Usage: Declaration, Initialization, and Access

Learn how to declare, initialize, and access fields in C#, including readonly and static modifiers, and when to choose fields over properties.

C# fieldsfield initializationreadonly fieldsstatic fields
Diagram of a C# class showing fields, properties, methods, and events as building blocks.
C#

Understanding C# Class Members

Learn how C# class members define data and behavior: fields, properties, methods, constructors, events, nested types, and static members with practical examples.

class memberspropertiesmethodsconstructors
Diagram showing the three uses of the c# new keyword: object creation, member hiding, and generic constraint.
C#

Understanding the C# new Keyword: Operator, Modifier, and Constraint

Learn the three roles of the C# new keyword: the new operator, the new modifier, and the new() constraint, with code examples and common pitfalls.

C#new operatormember hidinggeneric constraints
Diagram showing a method returning a reference to an array element, with an arrow pointing to the original storage location.
C#

C# Ref Return: Syntax, Usage, and Performance

Understand C# ref returns: syntax, ref locals, restrictions, and the performance tradeoffs of returning references to array elements and fields.

ref returnref localsC# performanceC# syntax
Illustration of a C# method receiving an array reference, showing that the caller and method share the same array object.
C#

Passing an Array to a Method in C#: Syntax and Behavior

Learn how C# passes arrays to methods as references, including params, ref, and ReadOnlySpan for read-only access.

C# ArraysMethod Parametersparams KeywordReadOnlySpan
A compact arrow symbol transforming a multi-line method block into a single-line expression, illustrating the C# expression-bodied method syntax.
C#

C# Expression-Bodied Method: Syntax and Usage

Learn how C# expression-bodied methods simplify single-expression logic, where the syntax applies, and when a block body is the clearer choice.

C#Expression-Bodied MembersMethod SyntaxCode Readability