Is there a standard technical term for methods that mutate global state?
- "Unpure" is too strict, because the unpure methods
println("I don't consider stdout to be part of the global state")
anddate()
do not modify global state. - "Mutator method" comes close, but is often a synonym for "setter" and thus may only change one variable, or only change a local variable but not the global state.
- "Const method" seems to be used for C++ only and implies some technical details that are too strict (e.g., the method may not call any non-const method).
- "Mutating method" sounds good to me, but seems to be a term used in objective c only.
Update: By global state, I mean memory that is visible to other methods or other calls of the same method.
Since stdout cannot be read by any method of the program, println("I don't consider stdout to be part of the global state")
has the side effect of printing but does not change global state.