Skip to content
TaeyoungKim.dev

Variable, Literal, Constant, null, and void: Different Kinds of Absence and Value

CSWritten 3 min readTaeyoungKim
LinkedInX

Reading null and void as the same kind of “nothing” confuses a missing value with a function that returns no value. A literal writes a value directly in code; variables and constants give values names under different rules. When reading a declaration or call result, separate the value, its name, and its type.

Key terms

A literal writes a value directly; a variable gives a value a name. A constant restricts reassignment under a language's rules. null concerns an absent value or reference, while void commonly describes a function that returns no value.

TermMeaning
initial value / initialized valueA value supplied when something is first initialized; “initialized value” may also mean the value after initialization. Check the context.
default valueA value supplied when none is specified, according to the API or language rule.
original valueThe value before a change.
current valueThe value at the point being observed.
return value / returned valueThe value produced by a function or method call.

Terms to distinguish

TermMeaning
variable / varA named storage location or binding used to hold or refer to a value. var can abbreviate “variable” or be a declaration keyword in some languages.
literalA value written directly in source code. In int x = 10;, 10 is an integer literal; in String str = "abc";, "abc" is a string literal.
constant / constA value or name defined to resist change, with the exact guarantee depending on the language and its const rules. A constant binding does not always make an object deeply immutable.
primitive data typeA language-defined basic type, such as an integer or floating-point type. Which types count as primitive depends on the language.
null / nilLanguage-specific representations of an absent value or object reference. Their type, comparison rules, and permitted uses differ by language.

Terms in code

TermMeaning
voidIn many languages, a return-type notation for a function that does not return a value. Its exact meaning varies by language; it is not the same concept as a null reference.
static variableA variable associated with a particular program or type scope rather than each ordinary call or instance. Its sharing, scope, and lifetime depend on the language.
local variableA variable available within its declaring local scope, often a function or block. Scope and lifetime depend on the language and runtime.

Reading a technical document

If you treat null and void as interchangeable, you may miss whether a value is absent or a function has no returned value.

When several unfamiliar terms appear together, identify the subject and action first. Then ask whether each remaining term names a value, a binding, a type, or a scope.

Key takeaways

Distinguish a value, a name for a value, and an absent value.

  • initial value / initialized value — A value at initialization; read the precise usage in context.
  • literal — A value written directly in source code, such as 10 or "abc".
  • local variable — A binding available in its declaring local scope, subject to language-specific lifetime rules.

Author

TaeyoungKim

Connecting technical foundations with implementation, verification, and production decisions.

#developer terminology#values#types#vocabulary series 6

Read next