Value type
A value type is a programming-language type whose values are treated as independent values when assigned or passed, rather than as references to a shared object.
.NET in Action, Second Edition
A value type is a .NET type whose values contain their data directly.
- How it is used
- Explains how .NET classifies types and why value/reference behavior matters when values cross method and API boundaries.
- How deep it goes
- Defines direct data storage, contrasts references, and introduces boxing without detailing copying or parameter-passing semantics.
- Examples
- Uses an int passed to Console.WriteLine and an integer Book.Id property to illustrate boxing and nullability.
- What you can do after
- Evaluate whether a .NET type is a value type and recognize when C# boxes it for an object parameter.
Read how .NET in Action, Second Edition explains value type →
F# in Action: A Revised Edition of Get Programming with F#
A value type is a type whose variables directly contain their data and whose values are copied when assigned or passed by value.
- How it is used
- Uses value types to model tuples or records with pass-by-value semantics when performance requirements warrant them.
- How deep it goes
- Explains storage, passing, copying, and garbage-collection tradeoffs, but defers detailed performance measurement to testing.
- Examples
- Uses struct tuple syntax and [<Struct>] record syntax as concrete examples.
- What you can do after
- Apply F# struct syntax to create value tuples or value-type records, then benchmark the resulting representation.
Read how F# in Action: A Revised Edition of Get Programming with F# explains value type →
Related concepts
- structincludes · A struct is a composite data type or structure that groups related fields or values into a single unit.
- reference typecontrasts with · A reference type is a type whose values provide indirect access to objects or state stored separately from the values themselves.
- primitive data typeincludes · A primitive data type is a fundamental, language-provided type for representing a basic value, rather than a composite of multiple values.
- zero valueconfigured by · A zero value is the default, type-dependent value assigned when a variable, field, or newly allocated value has no explicit initial value.
- value objectequivalent to · A value object is an object whose meaning and equality derive from its attribute values rather than an independent identity, typically with immutable state.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

