Value Semantics
Noun · Development
Definitions
A programming model where assignment and argument passing produce independent copies, so mutating one variable never affects another. Structs in Swift, primitive types in most languages, and types implementing copy constructors in C++ exhibit value semantics, in contrast to reference semantics where variables share the same underlying data.
In plain English: A rule where copying a value gives you a fully independent duplicate — changing the copy never changes the original.
Example: "Swift arrays have value semantics with copy-on-write, so you get the safety of independent copies without the cost of copying until you actually mutate."