|
|
|
|
|
by iLemming
213 days ago
|
|
> Why do we use the terms "mutable" and "immutable" to describe those concepts? Mutable is from Latin 'mutabilis' - (changeable), which derives from 'mutare' (to change) You can't call them read-only/writable/etc. without confusing them with access permissions. 'Read-only' typically means something read-only to local scope, but the underlying object might still be mutable and changed elsewhere - like a const pointer in C++ or a read-only db view that prevents you from writing, but the underlying data can still be changed by others. In contrast, an immutable string (in java, c#) cannot be changed by anyone, ever. Computer science is a branch of mathematics, you can't just use whatever words you think more comfortable to you - names have implications, they are a form of theorem-stating. It's like not letting kids call multiplication a "stick-piling". We don't do that for reasons. |
|