Hacker News new | ask | show | jobs
by nailer 3627 days ago
Note his call back hell is exacerbated by the unnecessary 'else' after checking for errors and returning.

I'm not sure that .bindTo() chaining reads any better than .then() chaining or async.waterfall().

2 comments

The point isn't really to argue for another naming scheme for Promises. The construction of the Callback class is used to build up the reader's understanding the Monadic structure before introducing Categories and Kleisli Categories. The comparison of the structure of these abstractions comes up several times.

I think the final example (of myLongOperation) reads extremely well, and is pretty minimal, as the author states.

We have to handle errors at least one time during the operation. Both Promise and Callback classes propagate error in the computation and delay error handling till the last step (usage).

I agree that bindTo is not much different from then, but IMHO pipe and pipeTo are.