3 ms·
> something which is contagious I guess what you're trying to say is that once you adopt Promises a large portion of your code will have to be tailored to use
by Nemcue 11y ago
> something which is contagious
I guess what you're trying to say is that once you adopt Promises a large portion of your code will have to be tailored to use it.
To which I respond: .. yes, so what? It's better than callbacks. And it's better than some "magic fairydust" that doesn't make it explicit that you're doing something async.
- eagsalazar2 11y agoPromises are better than callbacks but far worse (in terms of complexity they create) that synchronous code. This might be fairy dust but it crushes promises for reducing developer cognitive load. Having said that I agree with the person who commented that async/await is a better way to go (although sadly not really an option in CS yet).
- monsieurbanana 11y agoSorry could you explain what CS is? I can't think of anything besides computer science.
- seeekr 11y agoCoffeeScript! :-) One of those neat compiles-to-JS languages! Edit: And the "problem" with async/await and CoffeeScript is that the former is currently available in various JS transpilers but you can't use one of those and CoffeeScript at the same time.
- modarts 11y agoWhy would someone invest in Coffeescript at this point with ES6 + Babel being a highly viable option?
- dmak 11y agoDefinitely better than callbacks, but debatable wether this solution or promises is better. I like both.
- beejiu 11y ago> once you adopt Promises a large portion of your code will have to be tailored to use it. This isn't a necessity, since you can create a function which both returns a Promise and accepts a callback. Most Promise libraries make this easy to support, which makes it easy to introduce Promises into projects that already use callbacks, and vice-versa.