One name == one meaning

This is a draft I started to write two years ago but never finished. I want to put it out anyway.

Definition

By “name” I mean anything (identifier, number, pointer, reference) that directs to a value stored somewhere. The name may either be human-readable (named variable, string key) or machine-readable (machine address in memory, UUID, hash etc.), it is not important.

A “meaning” is really anything that an entity can be kept around for. For an object, that’ll be its behavior. For a collection, it will be the individual items stored inside it plus the lookup mechanism the collection provides.

As long as you have a value that can be used to look up another entity, you have a name.

Why “one name == one value” is desirable

In a system in which the rule holds, any subsystem (i.e. module, object, function etc.) that has gotten a hold of a name can be certain that the meaning that name is tied with will not change.

Result of any calculation based on those meanings will also retain its meaning.

A lot of design problems around the need to ensure the consistency of data observed by multiple pieces of code disappear as soon as you prohibit any of the agents that obtain a name to modify the meaning behind it.

But what to do if I need to change the meaning?

Of course, not everything can and should be made immutable. But making names mutable should not be a default choice. Modern languages provide means to avoid that.

I do not have time to write in more details here, there is enough information on the Internet about this subject [1].

More than just in programs

But it turns out that this idea applies not only to programs, but to many processes beyond that.

Examples

  • API versioning.
  • Git and blockchains.
  • Open-Closed principle.

See this: https://en.wikipedia.org/wiki/CPUID#EAX=3:_Processor_Serial_Number

This CPUID leaf returns the processor’s serial number. The processor serial number was introduced on Intel Pentium III, but due to privacy concerns, this feature is no longer implemented on later models (the PSN feature bit is always cleared).

In Python:

  • A tuple of numbers is immutable and as such its id()
  • A list of numbers is mutable. Any reference to it
  • Numbers themselves are names that refer to themselves as the only meanings they have.

The “one name == one meaning” principle states that the meaning does not change over time.

There may be more than one name (aliases) for the same entity. As such, oftentimes one has to compare two names to see if they refer to the same meaning.

Equality

Not finished

Scheme provides three primitives for equality and identity testing: - eq? is pointer comparison. It returns #t iff its arguments literally refer to the same objects in memory. Symbols are unique (‘fred always evaluates to the same object). Two symbols that look the same are eq. Two variables that refer to the same object are eq. - eqv? is like eq? but does the right thing when comparing numbers. eqv? returns #t iff its arguments are eq or if its arguments are numbers that have the same value. eqv? does not convert integers to floats when comparing integers and floats though. - equal? returns true if its arguments have the same structure. Formally, we can define equal? recursively. equal? returns #t iff its arguments are eqv, or if its arguments are lists whose corresponding elements are equal (note the recursion). Two objects that are eq are both eqv and equal. Two objects that are eqv are equal, but not necessarily eq. Two objects that are equal are not necessarily eqv or eq. eq is sometimes called an identity comparison and equal is called an equality comparison.

Examples of following the rule

  • Immutable variables
  • Compilation time
  • Static single-assignment form in compilers
  • Git SHA references
  • Excel cells
  • API versioning

Examples of breaking the rule

Global mutable variables — the same name may mean multiple things in space and time.

Shared writable memory. Supporting the notion requires underlying hardware to implement quite complicated ownership and messaging protocols between cached copies of data and a shared vision of it.

Many human concepts. E.g. “Agile” in software used to mean quite different thing compared to what people think of. The same applied to the MVP pattern, and Dependency Injection, meaning of which has been hijacked in some languages. Semantic Diffusion https://martinfowler.com/bliki/SemanticDiffusion.html

Implementation specifics

Real modern hardware is always mutable, so GC or other memory policy is needed to keep memory footprint of all the names that have been created but possibly no longer used, in check.

Recursion is the method to implement iterations. Loop constructs (for, while) cannot exist, because the loop variable refers to different values at different iterations. Recursion adds context to names, thus making different iterations use different names (context is included into naming).

One name == zero or one meaning

Another conceptual problems with names is append-only data structures.

Not finished.

References

  1. https://blog.cleancoder.com/uncle-bob/2018/04/13/FPvsOO.html

Written by Grigory Rechistov in Uncategorized on 27.08.2026. Tags: functional programming, value, single source of truth,


Copyright © 2026 Grigory Rechistov