Re:“Mostly functional” programming does not work (2014)
by viraptor on Monday June 22, 2015 @10:24AM
(#9758498)
Simplest situation in order: multiple logs, multiple logs, default uninitialised log behaviour.
These aren't situations specific to the pure/not issue. You have to know how you deal with them in either case. The uninitialised case it a specific case of: what if your logging target goes away / never existed. Signatures won't help here, because that's a dynamic property of the system.
What if you call f2 multiple times? What if you call f2 an unpredictable number of times? What if you call f2 in a situation where the logging system isn't initialised?
The parameters and return value are not the only things that matter.