Re: Resolving Futures w/multiple values

On 04/23/2013 02:20 PM, Domenic Denicola wrote:
> Just as yoy can't return (or throw) multiple values from a function, 
> so you can't fulfill (or reject) a promise with multiple values. 
> Promises model asynchronous return/throw and the associated call 
> stack, so multiple fulfillment values would be nonsensical.
>
> You may find 
> http://domenic.me/2012/10/14/youre-missing-the-point-of-promises/ helpful?

I understand the desire to make something analogous to synchronous 
programming. However, sometimes analogies can be taken too far; it may 
be a mistake to hold so rigidly to an analogy that we miss out on useful 
functionality that improves upon the model we are analogizing. One 
example of this would be the calculator UI Microsoft built to imitate a 
hand-held calculator from the 1970's.

We don't have the same single return-value restrictions in modern 
asynchronous programming -- and developers have been taking advantage of 
that to write more expressive APIs. That this new ability has been 
embraced is both an indicator that maybe it should continue -- and a 
reason for Futures to support it.

-- 
Dave Longley
CTO
Digital Bazaar, Inc.

Received on Tuesday, 23 April 2013 18:45:30 UTC