3 ms·
Passing a big structure to a function doesn't make that function impure. But passing a structure containing objects with impure methods does make the called fun
by garethrowlands 6y ago
Passing a big structure to a function doesn't make that function impure. But passing a structure containing objects with impure methods does make the called function impure.
Passing a big structure to a function is a bad idea in any paradigm because it's a big dependency. Instead, you should write the function to operate on the data that it needs and pass just that when you call it.