3 ms·
That is why I would like to hear them :-) I know most people use Promises to escape the call-back hell, but you can do that with async library as well, so mayb
by a-saleh 10y ago
That is why I would like to hear them :-)
I know most people use Promises to escape the call-back hell, but you can do that with async library as well, so maybe you just like writing "return cb(err);" more than "return Promise.reject(err);"
Maybe you like, that you need to deal with the err in the call-back, while \w promises it is easy to write code that just silently fails?
- Yaggo 10y agoI also prefer callbacks. Here are my reasons: - They are simple (fully transparent) - They are the simplest good enough solution for many problems - Cleaner code than new Promise().then().then().then().catch() clutter - Yes, I like nested indentations (good functions are short anyway) - They perform well As a side note, I also prefer coffeescript, snake_case, CONSTANTS, and avoid using classes, prototypes, and this. I'm not very happy with the recent development of EcmaScript, too much complexity and unnecessary new concepts.
- mpfundstein 10y agoBesides the last point I think I disagree on everything you have said :P
- spion 10y agoGive me any moderately complex callback-based code, and I'll make it look cleaner with promises and ES6. And I'd like to know what you mean by "fully transparent"