Skip to content
Home

Value (computer science)

A value is a discrete piece of information manipulated by programs — e.g., numbers, strings, booleans, objects — distinct from variables or storage that may refer to it.

An ordinary meaning of value in computer science is a piece of information that programs create, manipulate and transfer. Values are the results of expressions and the contents of data structures: examples include numeric literals, text strings, boolean flags, null or undefined markers, and structured aggregates such as lists, records and objects. A value is distinct from the variable, memory cell or name that denotes or stores it.

Characteristics and categories

Values are commonly classified by type and by semantics. Primitive values (integers, floating-point numbers, characters, booleans) contrast with composite values (arrays, tuples, objects). Languages also distinguish value semantics—where copying duplicates the data—from reference semantics—where multiple references alias a single underlying object. Some languages treat certain values as immutable, meaning they cannot be altered after construction.

Representation and behavior

At runtime a value may be represented directly (unboxed) or via a reference (pointer or handle). This affects copying cost, identity and equality. Equality may be structural (contents equal) or referential (same object). The distinction between lvalues and rvalues in languages like C and C++ is about whether an expression designates an assignable object or merely a value yielded for computation.

Uses and examples

Values appear whenever programs evaluate expressions, pass arguments, return results or serialize data. Constants and literals are fixed values written in source code; computed values arise from function calls and operations. Functional programming emphasizes values and immutability, enabling easier reasoning and parallelism, while imperative programming often relies on mutable values stored in variables.

History and theoretical role

The notion of value is central to semantics and type theory. Formal systems such as the lambda calculus, operational semantics and denotational models describe how values flow through programs and how types constrain those values. Type systems classify allowable values and help catch mismatches before runtime.

Notable distinctions

  • Value vs variable/name: a value is the data; a variable names or stores it.
  • Identity vs equality: same object versus same contents.
  • Mutable vs immutable: whether a value can change after creation.
  • Primitive vs composite: basic atomic values versus aggregates.

Understanding values, their representation and semantics is fundamental to programming language design, program correctness and performance engineering.

Related articles

Author

AlegsaOnline.com Value (computer science)

URL: https://en.alegsaonline.com/art/104108

Share

Sources