2 ms·
This kind of misses the point - sure it's still simple for a four line function, but it's whether callback oriented code scales for anything other than the most
by antihero 14y ago
This kind of misses the point - sure it's still simple for a four line function, but it's whether callback oriented code scales for anything other than the most simple of projects.
- jrajav 14y agoIt does scale. I can vouch for it from personal experience. The smell is when you start constructing elaborate pyramids - but in that case, the callbacks are not to blame, you are for not making your processing code modular with well-defined, pluggable functions defined before the main async flow. None of the examples were long enough to merit separate function definitions, but he doesn't ignore the point: > Let’s assume that it’s good practice to organize your program into simple functions that have as few side effects as possible. > There is no law against writing simple, concise callbacks that defer to well-organized, side-effect-free functions for complex processing. In fact, I’d recommend using them in precisely that way.