4 ms·
I would argue that in this case, the author is technically wrong with his argument. You do not need to know the entire history of the foo object, only the intr
by Tinned_Tuna 14y ago
I would argue that in this case, the author is technically wrong with his argument.
You do not need to know the entire history of the foo object, only the intrinsic state and the arguments to the current method call to determine it's behaviour. This means that a method on an object can be modeled as add :: (foo, integer) -> integer.
That is not to say that this is necessarily easy, and yes, singletons do complicate this by making it difficult to know exactly what the intrinsic state of an object is as they essentially hold a reference to something which may be modified by something other than the foo object.
I fully agree that functional programming seems like a good idea right now, but I would also say that this particular problem is mainly due to the programmer failing to adequately control and rein in extra, unnecessary state.