C# Bites: Glossary

keywords and terms

Term Definition
Abstract ClassA class that cannot be instantiated directly and may contain abstract members that derived classes must implement.
AssemblyA compiled unit of code in C#, typically an .exe or .dll file.
Async/AwaitLanguage-level support for asynchronous programming; async marks a method as asynchronous and await suspends it until a Task completes without blocking the thread.
AttributeMetadata added to code elements using square brackets, used for reflection or behavior control.
Base ClassA class from which another class inherits implementation and functionality through the inheritance mechanism.
Boxing/UnboxingThe process of wrapping a value type in a heap-allocated object (boxing) or extracting it back (unboxing).
ClassA blueprint for creating objects. Can include fields, properties, methods, and events.
ClosureA lambda or local function that captures variables from its enclosing scope, keeping them alive as long as the function exists.
ConstructorA special method that initializes a new instance of a class.
ContravarianceGeneric type variance allowing a generic interface or delegate typed on a base type to be used where one typed on a derived type is expected.
CovarianceGeneric type variance allowing a generic interface or delegate typed on a derived type to be used where one typed on a base type is expected.
DeconstructionSyntax for unpacking a tuple or record into individual variables: (var x, var y) = point;.
Default Interface MethodsImplementation code provided directly in an interface definition, available to all implementing types without requiring them to override it.
Deferred ExecutionThe behavior where a LINQ query does not execute until the result sequence is actually enumerated.
DelegateA type-safe function pointer used to reference methods or implement callbacks and events.
DynamicA type that bypasses compile-time type checking, deferring member resolution to runtime.
EnumA distinct type representing a set of named constants.
EventA mechanism used to provide notifications, typically implemented with delegates.
ExceptionAn error-handling object used with try, catch, and throw.
Explicit ImplementationInterface member implementation that is hidden from the type's public surface and accessible only through the interface type.
Expression-Bodied MemberA method or property written with => providing a concise single-expression implementation.
Extension MethodA static method in a static class whose first parameter uses this, allowing it to be called as if it were an instance method on that type.
FieldA variable defined inside a class or struct.
Garbage CollectionAutomatic memory management that reclaims unreachable heap objects without explicit programmer action.
Generic ConstraintA where clause that restricts what types may be supplied as arguments to a generic type parameter.
IDisposableAn interface with a single Dispose() method enabling deterministic cleanup of unmanaged resources, typically via a using statement.
IEnumerableAn interface that exposes an enumerator over a sequence, forming the basis for foreach and LINQ queries.
IndexerAllows objects to be indexed like arrays using the this[] syntax.
InheritanceA mechanism where a class derives from one base class, inheriting its members and behavior and optionally overriding virtual members.
Init-Only PropertyA property with an init accessor that can be set only during object initialization, providing immutability after construction.
InterfaceA contract that defines members a class or struct must implement.
IteratorA method using yield return or yield break that produces values lazily through the IEnumerable pattern.
Just-In-Time CompilationRuntime compilation of .NET intermediate language (IL) to native machine code, performed by the CLR when a method is first called.
Lambda ExpressionAn anonymous function written using => syntax.
LINQLanguage Integrated Query - a set of query capabilities built into C# for filtering, projecting, and aggregating sequences.
Local FunctionA method defined inside another method, invisible outside its enclosing scope and able to capture outer variables.
Managed HeapThe memory area managed by the garbage collector where all reference-type objects are allocated.
MethodA function defined within a class or struct.
Multicast DelegateA delegate instance that holds multiple method references and invokes all of them in sequence; targets are added and removed with += and -=.
Named ArgumentA method call argument specified by parameter name rather than position, allowing arguments to be passed in any order.
NamespaceA container for organizing related classes and types.
Nullable Reference TypeA reference type annotated with ? to indicate it may hold null, enabling compile-time null-safety warnings.
Nullable TypeA value type that can also hold null, written as int?, bool?, etc.
Null-Coalescing OperatorThe ?? operator that returns its right operand when the left operand is null.
Null-Conditional OperatorThe ?. operator that evaluates a member access only when the object is not null, returning null otherwise.
ObjectAn instance of a class. In C#, all types derive from System.Object.
Operator OverloadingCustom definition of operator behavior (+, -, ==, etc.) for user-defined types.
Optional ParameterA method parameter with a default value that may be omitted by callers.
Out ParameterA by-reference parameter the method is required to assign before returning, used to return additional values.
OverloadingDefining multiple methods with the same name but different parameter lists.
OverrideReplacing a base class virtual method implementation in a derived class.
Pattern MatchingLanguage feature for type-safe conditional logic that simultaneously tests a value's type and properties, commonly used in switch expressions and is expressions.
Primary ConstructorA constructor declared directly in the class or struct header whose parameters are in scope throughout the type body.
PropertyA member that provides controlled access to a field using get and set accessors.
RecordA concise reference type (or value type with record struct) optimized for immutable data, with built-in equality and with expression support.
Readonly StructAn immutable value type declared with readonly that prevents any field from being modified after construction.
Ref ParameterA by-reference parameter that lets a method read and modify the caller's original variable.
Reference TypeA type (class, string, array, delegate, interface) whose variable holds a reference to heap-allocated data rather than the data itself.
ReflectionThe ability to inspect type metadata and invoke members dynamically at runtime via System.Reflection.
Sealed ClassA class that cannot be used as a base class for inheritance.
Sealed OverrideAn override marked sealed to prevent further overriding in classes derived from the current class.
SpanA stack-allocated view over a contiguous region of memory (array, string, or native buffer) enabling high-performance slicing without allocation.
StackThe per-thread memory region that holds local variables, method parameters, and return addresses for the active call chain.
StaticIndicates a member or class belongs to the type itself rather than to any instance.
Static Abstract MemberA static member declared abstract in an interface, enabling generic algorithms that require static operators or factory methods on type parameters.
Static LambdaA lambda prefixed with static that is forbidden from capturing instance or local state, preventing unintended allocations.
StructA value type similar to a class, stored inline (on the stack or inside another type), without support for inheritance.
Target-Typed NewSyntax allowing new() without repeating the type name when the type is already known from context.
ThreadAn execution path within a program. C# supports multithreading via System.Threading and the Task parallel library.
Try-Catch-FinallyControl structure for handling exceptions and guaranteeing cleanup code runs regardless of whether an exception occurred.
TupleA lightweight value type that groups heterogeneous values without defining a named class, using syntax like (int x, string y).
Type InferenceCompiler feature that determines a variable's type from its initializer when declared with var.
Unmanaged TypeA generic constraint (where T : unmanaged) restricting a type parameter to types that contain no managed references and can be used in unsafe pointer operations.
UsingUsed for namespace import or, with IDisposable, to ensure deterministic resource disposal at the end of a block.
Value TypeA type (int, double, bool, char, struct, enum) whose variable holds data directly and is copied on assignment.
VirtualMarks a method as overrideable in a derived class, enabling runtime polymorphism.
With ExpressionRecord syntax for non-destructive mutation: creates a new instance with specified properties changed, leaving the original unchanged.
Yield ReturnA keyword inside an iterator method that emits one value to the caller and suspends execution until the next value is requested.