Name for a method that has only side effects
问题 So, a method that alters its object is a mutator . A method that does not alter its object but returns a value (or reference to a value) is a getter . Is there a widely used name for a method that does not alter its object, does not return a value, but potentially alters objects passed to it as arguments. That is, a method that would only every be called for its side-effects on the arguments. These methods are quite common if you are keen on the Strategy design pattern. 回答1: I call these