The real issue regarding callbacks in my mind is when you have to deal with 
errors.

Its just a ridiculous pain to check for errors everywhere. I got to the 
point where I have to use promises, just to be able to use that fail 
handler. 

Really, if you stop to think about it, A LOT of time, you simply do not 
care which error happened and where, it wont affect any state of your 
business logic. Obviously you want to know where the error happened (as a 
developer, for bug fixing or any other improvement), but for users, who 
cares if an error occurred because a developer forgot to check if that 
variable was an array, or if the database failed.

At least, this is valid for the applications that I am developing. For some 
low level stuff, it may make sense to know whats up. But when I just need 
to get JSON, process a bit, validate a bit, put that in a database and 
return some more JSON, its just not acceptable to deal with errors as its 
done with callbacks. 

As an outsider, thats my view, I am far from a node/javascript expert, I 
just want to be able to develop good web applications fast.

I am actually using coffee-script AND promises. Although its much better to 
do callbacks with coffee-script, the error handling as I said above just 
killed me.

Em sábado, 17 de agosto de 2013 02h53min26s UTC-3, Andrew Kelley escreveu:
>
> I wrote this article as a response to all the recent callback hate:
>
> http://andrewkelley.me/post/js-callback-organization.html
>
> It contains:
>
>    - Acknowledgement of better async syntax than what callbacks offer
>    - Tips on how to structure callback based code
>    - Reasons why you might want to stick with js instead of a 
>    compile-to-js language.
>
>

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to