Value Type

Noun · Development

Definitions

  1. A type whose instances are stored directly (typically on the stack) and copied on assignment, rather than being accessed through a reference to heap-allocated memory. In C#, structs and enums are value types; in Swift, structs, enums, and tuples are value types.

    In plain English: A type of data that gets fully copied when you assign it to a new variable, rather than having both variables point to the same shared data.

    Example: "We switched the coordinate struct from a class to a value type and eliminated a million small heap allocations per frame."

Related Terms