3 ms·
yeah I think the article actually starts with that Promise-based code snippet. Even the sequential graph is based on the promise-based code.
by lorean_victor 8y ago
yeah I think the article actually starts with that Promise-based code snippet. Even the sequential graph is based on the promise-based code.
- ricardobeat 8y agoLook closer - the original is way more convoluted - there is no reason to use `new Promise` constructors when you're dealing with other promise-returning functions.
- lorean_victor 8y agoyes you are right the constructors aren't indeed needed. as for the complexity of the graph, basically the way I see it is that even this promised based method is a way to solve the problem of putting the graph into the proper promise-based format (for example, chain doA and doC and return an array of their result) vs simply drawing the intended graph. I mean it does take sometime to get used to it specially if you are really used to just working with code (which I myself originally was), but since the graph is the more intuitive way to represent it compared to other methods, after going through the learning curve it seems to be less complex and easier to manage. that said its not like I have conducted proper academic research on the matter and it might as well be a pretty subjective thing.