3 ms·
rtdsc: > Was that addressed to strongloop.com? They are the ones that posted an example with promises using 27+/-whitespace lines of code and the initial proble
by inglor 13y ago
rtdsc:
> Was that addressed to strongloop.com? They are the ones that posted an example with promises using 27+/-whitespace lines of code and the initial problem algorithm only had 4 lines.
Oh wow, this is my fault, I didn't read what they did there. I have __no idea__ why it took them 27 lines to implement this. It's rather trivial with promises.
- They have a .then followed by a .map there causing nesting for no reason whatsoever.
- They also get the file name, but handle this very poorly (with an array), where they could just do it as a part of the .map (the .all and .then are completely redundant) there
- They assume the possibility of directories, I didn't. That .filter is justified but that's the only thing one might have to add here.
- Generally, it's poor promise code.
I guess that promises are just not their tools of choice and they just used them _for that post_.