Search code examples
stringmutable

Is 'mutable' the same as the word 'modifiable' in relation to strings?


When we talk about strings as being mutable, is this synonymous with using the word 'changeable' or 'modifiable' or is there some additional nuance to explain why this jargon is used instead of a simpler word like 'modifiable'?


Solution

    • mutable
      • "liable or subject to change or alteration."
    • modifiable
      • "to change somewhat the form or qualities of; alter partially;"

    conversely

    • immutable
      • "not mutable; unchangeable; changeless"
    • unmodifiable
      • "incapable of being modified in form or character or strength"

    In programming you more often hear the terms mutable and immutable than you do modifiable and unmodifiable. However I think it is safe to say that either way has the same meaning.

    But when in Rome... so you should use mutable and immutable as they are the more commonly used terms (at least in my experience).

    As to why that choice? I asked my mother in law (she is up on words :-) and from a non-programming point of view "mutable" is shorter then "modifiable"... seems likely enough of a reason to me.