(Edits at the bottom.)
The Question
I was tagging a question with mutability and I noticed that there was a tag mutability and another one called immutability. The mutability tag has no wiki-description and was used 86 times, and the immutability does have a description and was used almost 1800 times.
I could be wrong, but these tags seems to be really similar to each other. A cursory look at questions tagged mutability shows that many of them are also tagged with immutability. That's like tagging java with not-c or stability with unstable. Huh?
Why Change?
Grammatically they're the same word, with a prefix. (See edit 2 below.)
In my mind mutability would generally refer to the idea of an object being mutable or immutable, similar to "stability" referring to something being stable or unstable. In other words, I would think that mutability would cover both cases. Except, of course, that the usage has mostly been the other way around - the numbers show a strong preference for immutability.
There are also two tags already mapped to immutability: Namely, immutable and immutable-class. This makes sense, but all three tags fall under the umbrella concept of mutability, so shouldn't they all remap to a mutability tag with a proper wiki? This would cover mutability and immutability, providing a single tag to rule them all*.
A lot of the uses for immutability are asking about a particular situation where they want to know if something is immutable or how to make something that is mutable immutable.
I don't think someone looking to answer mutability questions is going to look only for situations where they are being asked if something is immutable, because... well... they're opposites. Both tags mean the same thing, from complementary perspectives.
Proposed Resolution
What does the community think about combining them under mutability?
I propose a wiki similar to the one in use for the immutability tag, but with broader scope, like so:
Mutability is the idea that some pieces of data can be changed after creation. Such data is called "mutable." (Mut-able: It can be mutated.)
Data that cannot be mutated after it has been created is said to be immutable. Modifications are instead made by copying the data. A property of immutable data is that it is referentially transparent.
Mutability is a pattern found in many branches of programming; immutable objects are used widely within object oriented languages (such as Python's
str
type, Java'sString
andInteger
type, .NET'sSystem.String
, etc.), functional programming (esp. Haskell and other pure languages), and other paradigms. The cocoa-touch framework has mutable and immutable versions ofNSArray
,NSString
etc.
Edit:
Some folks are positing that mutability and immutability have opposite meanings so they should be different tags.
I think a good way to consider this is from the perspective of a book index. Would mutability and immutability both be listed? Probably. But one entry would likely say "see {mutability}."
More extremely: There's no such thing as immutability. The correct word is mutability, which describes if an object is mutable or immutable.
Edit 2:
I did some more research, and immutability is the same root word as mutability. The prefix im
just means not. (See this and this on English.StackExchange.com)
As folks have pointed out, immutability is the term people run into more often because mutable is the default in many popular programming languages, so the tags are used "counter to" accepted grammar.
Edit 3:
So it seems that there are a few arguments for either side. For my own benefit I'm going to try and put them here.
For:
- The tags should be synonyms because they're often used together anyway.
- Grammatically, they're the same word.
Against:
- Many people are interested in making something immutable, and don't care about the opposite state, so the tag is useful on its own.
- Grammar isn't a valid consideration here, we care about how people express their questions.
I think that there's something else to consider:
Are tags there to express intent, or are they there to help users find questions of a given topic?
If tags exist to express intent (*i.e. "I want to make something immutable," or "I want to learn about immutability in this context") then it makes sense to have two tags. I want to make something stateful in c, or I want to make something immutable in javascript.
If tags exist to help people find questions, then a slightly more general tag covering both cases would help people answering find appropriate questions, and by extension help askers obtain answers. If we take a subject-driven approach, instead of an intent-driven approach, we find the appropriate tags to be state, c and mutability, javascript.
The Stack Exchange Tour says:
All questions are tagged with their subject areas. Each can have up to 5 tags, since a question might be related to several subjects.
It looks to me that tagging is for subject matter, not intent. If that's the case, and you agree with my assessment of the two sides here, then I think that synonym-izing is appropriate.
*where appropriate.