2 ms·
> (There’s nothing wrong with imperative code confined to the scope of a function or a well defined object) This is often the case with hash tables. Sometimes
by zelphirkalt 4y ago
> (There’s nothing wrong with imperative code confined to the scope of a function or a well defined object)
This is often the case with hash tables. Sometimes one simply wants to store an info and the fact, that this info has been discovered or processed or occurred. If one makes the hash table inside the function where it is used, then the important aspects of no side effects and no mutation of arguments of the function are still preserved.
However, sometimes a problem can arise later, when wanting to parallelize something inside that function involving the hash table. So one needs to be a bit careful here as well.