3 ms·
I have learned to manage callback hell in a way that results in fairly flat code that is easy to follow regardless of the callback depth. It still turns to hel
by austincheney 8y ago
I have learned to manage callback hell in a way that results in fairly flat code that is easy to follow regardless of the callback depth. It still turns to hell though when multiple decisions (more than 2) that result in the determinate callback path.
For example, am I going to minify for beautify code and am I reading from a file, stdin, or a directory and am I going to output the actual processed code, a report, or something to stdout? If I were doing a comparison then I to make those same decisions on two separate sets of data and consider additional decisions.
In this horrid example its decision hell plus callback hell and the result is a challenge in flow control.