If I would choose which tool is best for my project just by popularity 
factor I wouldn't go far.

It's understood that Async is more popular as it doesn't introduce much 
learning factor and most developers are looking for quick solutions. To get 
promises you need to devote a while understand it. When you'll do it, 
you'll see that abstraction provided by promises gets you level higher, 
where you can easily produce complicated flows which are difficult to 
configure just using callbacks style.

Callbacks are base, and simple asynchronous function should definitely 
speak that convention. Moment where promises become significantly helpful 
is when you want to bind tens of asynchronous operations.

Other important thing, while Q plays significant role in bringing promises 
to Node.js world (it's also library that inspired many others), it's good 
to know there are other promise solution which I think in many areas play 
better. So judging promises just by trying Q implementation, is also 
limited approach.


On Monday, November 12, 2012 7:46:05 AM UTC+1, Mikeal Rogers wrote:
>
> It's great that you have a strong opinion. Here's some numbers:
>
> Here's the number of modules that depend on async and Q.
>
> async: 975
> Q: 109
>
> Here are the numbers of downloads in the last month.
>
> async: 120,271
> Q: 33,242
>
>
> Some people clearly like promises, but the dominant pattern in node is not 
> promises, it's callbacks, with complex callback issues managed with async.
>
> Stating your opinion strongly does not make it a fact. This is your 
> preference, and many others, but not the majority.
>
> If you write a library, it better use callbacks if you want people to use 
> it. Using callbacks in your own application code is the path of least 
> resistance for using the majority of value in the node ecosystem. That's a 
> fact, there are numbers. It's not everyone's preference, but it's the most 
> popular by far.
>
> -Mikeal
>
> On Nov 11, 2012, at November 11, 20125:18 PM, Andy 
> <[email protected]<javascript:>> 
> wrote:
>
> To reply to my own very old thread after getting some solid experiences 
> with promises, the answers to my questions are:
>
> 1. *async* is a library that passes callbacks around. it's ugly and it 
> sucks.
>
> 2. a* promise *is just an object. Don't let anyone tell you differently, 
> they are just trying to confuse you. It's an object that has method names 
> that everyone's agreed on, like *then *and *done *which will magically 
> trigger your callbacks for you. With promises, you include *Q* and you 
> just pass around Q objects (called deferreds and promises). It's just that 
> everyone agreed that the promise object will have a *.then* method, which 
> you can call and your function jumps next in line onto the promise chain 
> magically.
>
> The libraries should *not *be used together. Once you get your head 
> around promises and use them in field you won't want to use anything else.
>
> If you are exposing an API, you should still take/call a callback. If 
> you're writing a database client you don't want to give the user a promise 
> and force them into your model. Just call their callback at the end of your 
> own, internal beautiful promise chain. It will be our terrible secret.
>
> Promises aren't perfect and can get strange when doing some complex 
> composition (lots of return statements to return promise chains), but they 
> make writing async code soooooo nice.
>
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected] <javascript:>
> To unsubscribe from this group, send email to
> [email protected] <javascript:>
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to