In Chapter 23 of “Object Oriented Software Construction” (1988), Betrand Meyer makes a distinction between side effects, concrete side effects, and abstract side effects.
Meyer defines a side effect in the following quote:
A change performed by a function is known as a side effect to indicate that it is ancillary to the function’s official purpose of answering a query.”
And he defines a concrete side effect in a definition box as:
A function produces a concrete side effect if its body contains any of the following: an assignment, assignment attempt or creation instruction whose target is an attribute, or a procedure call.
This distinction is hard for me to understand though, since I cannot think of an examples of functions which produce side effects but which do not produce concrete side effects. Meyer does not give us any either.
Would Meyer say that side effect and concrete side effect are synonymous? Or are there a class of side effects which are not concrete side effects?
(Note, the answer is not abstract side effects, since abstract side effects are themselves concrete side effects.)
2
Heating the processor and losing time by useless computations is a side effect which is generally ignored, so could be considered as not very concrete. It is not concrete according to the quoted definition of Meyer.
This is why compilers are permitted to optimize useless code like
/// spend some time busy waiting in a useless computation
for (int i=1; i<10000000; i++)
(void) log(5.0*i);
into an empty block.
This looks silly, but a lot of benchmark related questions are wrong because the compiler optimize code -by ignoring it-
BTW, at the lowest physical level, every computation has a thermal side effect.
So we always think in terms of some abstract machine, and we always ignore some uninteresting side effects (and care about some other side effects, notably interesting input or output). Sometimes you might even consider some debugging output as some ignored side effect. Some people are on the contrary very concerned about the energy consumption (e.g. for wearable devices) and they don’t abstract that side effect.
2
From the comments we discussed the following: it could be a side effect that is not actually directly in the function called, but in a function called by that function? So function A is called. It calls function B and function B has a concrete side effect and function A is then sad to have a side effect, because it calls function B.