Re:JavaScript Promises Discussion: Make Them Monadic? (2013)
by todd_wanna_code on Thursday February 15, 2018 @11:02PM
(#16389761)
> There are still places where callbacks are better)
Like? I am genuinely interested in knowing the drawbacks of promises and places where a callback like structure is more favourable. By the way, I am not contradicting you, just trying to learn.
Re:JavaScript Promises Discussion: Make Them Monadic? (2013)
by imtringued on Friday February 16, 2018 @09:01AM
(#16392330)
A promise can only be activated once. You still have to use callbacks for buttons and other things that can be activated more than once.
The problem is that this is a field that has been heavily studied, and there are great solutions to this problem that also solve countless other problems, and interop well with each other. The way promises work, they solve that ONE problem but throw away the rest.
If you have the choice between 2 mostly equivalent solutions to solve a problem, but one of the solutions also solve 10 other problems with essentially no drawback, why would you choose the former?
This is probably already linked in this thread somewhere and is also probably was prompted someone to post this old issue to Hacker news, but this is a good explanation of the problem:
https://staltz.com/promises-are-not-neutral-enough.html