On Wednesday, 24 December 2014 at 09:18:43 UTC, Ola Fosheim
Grøstad wrote:
Not really, because you should strive to keep mutable state
local.
Even if it's local, there are still many similar values to see:
return n>0 ? x : 0;
Validation does not belong to the implementation, so "the right
way" is to put it in a wrapper before you call the function
that does the actual work.
Unlikely to be done. Sanitization is usually done in place.
When functions get long and complicated and evolve over time
then all mutable state become a source for errors.
Just wanted to say immutability doesn't look that fool-proof.