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,980 guides across 14 topics

Topics

Latest guides

Diagram showing static and instance members in C# with memory allocation and object references.
C#

C# static vs instance: Key Differences

c# static vs instance: Learn the key differences between static and instance members in C#, including memory, thread safety, and when to use each.

static membersinstance membersC# programmingobject-oriented design
Illustration of a C# static class as a sealed container with shared static members.
C#

C# Static Class: Usage, Limitations, and Tradeoffs

C# static classes: syntax, behavior, use cases, and tradeoffs for utility and helper code.

C#Static ClassObject-Oriented ProgrammingCode Organization
Diagram showing C# protected internal access combining derived class and same-assembly visibility
C#

C# Protected Internal: Union Access Explained

c# protected internal: Learn how C# protected internal combines protected and internal access, when to use it, and how it differs from private protected.

C# access modifiersprotected internalC# inheritanceC# visibility
Diagram comparing C# object creation methods including constructors, factories, and dependency injection.
C#

C# Object Creation: Choosing the Right Approach

Explore C# object creation techniques and when to use them: constructors, object initializers, factory methods, dependency injection, and reflection.

C#Object InitializationFactory PatternDependency Injection
Illustration of a C# class declaration showing the class keyword, a class name, and braces, with subtle icons for access modifiers and inheritance.
C#

C# Class Declaration: Syntax and Variations

C# class declaration syntax and variations: access modifiers, inheritance, static and partial classes, nested types, and common declaration mistakes.

C#class declarationobject-oriented programmingaccess modifiers
Diagram showing a ref local variable pointing to the same memory location as an array element
C#

C# ref local: aliasing variables without copying

Learn how C# ref locals alias existing storage without copying, work with ref returns, and follow compiler restrictions. Includes practical examples and guidance.

C#ref localref returnsperformance
A technical illustration showing two paths for C# parameter passing: one where the caller initializes a value before the method modifies it, and one where the method produces a new value for the caller.
C#

C# ref vs out: Choosing the Right Parameter Modifier

Understand the practical difference between C# ref and out parameters: initialization rules, compiler enforcement, and when to use each modifier.

C#ref parameterout parametermethod parameters
Illustration of a StringBuilder buffer with appended segments, showing how text is added without creating new strings.
C#

Using StringBuilder.Append in C# Without Wasteful Allocations

Learn how to use StringBuilder.Append efficiently in C# to build strings without repeated allocations, with practical examples and performance tradeoffs.

StringBuilderString ConcatenationPerformance.NET
Comparison of C# string and StringBuilder showing immutability and mutable buffer.
C#

C# String vs StringBuilder: When to Use Each

Learn when to use C# string versus StringBuilder, how immutability affects performance and memory, and how to choose the right approach.

C#.NETStringBuilderString Concatenation
Diagram comparing string concatenation and StringBuilder memory allocation in C#.
C#

C# StringBuilder: When and How to Use It

Learn how to use C# StringBuilder effectively, including when it improves performance, common methods, and thread-safety considerations.

StringBuilderC# PerformanceString ConcatenationMemory Allocation