3 ms·
Very well put. I run into this all the time in the name of "reducing complexity", when it is really hiding it under the rug. My personal approach to combat thi
by mejutoco 4y ago
Very well put. I run into this all the time in the name of "reducing complexity", when it is really hiding it under the rug.
My personal approach to combat this is better data structures that model the problem (and are checked by the compiler). Once this is in place I try to "flatten" the calls, so that things are mostly at the top level, or few levels deep, which usually comes up naturally once the data structure is consciously defined.
I try to have as much code as possible be "structure in - structure out" (pure functions) and to concentrate stateful code to work on the structure's fields/values. This is surprisingly easy once the data structures match the problem, instead of only growing organically.