To be clear.
I said the code I posted wasn't working on coffeescript. But yours does in 
certain cases.

coffeescript:
myThing.onEvent myHandler
myHandler = -> 

^ This works, assuming the given event will be emitted some time in the 
future, once the call stack has unfolded.

coffeescript:
myCollection.map myMapper
myMapper = ->

^ this doesn't work because map calls its callback synchronously.

This makes for an inconsistent behaviour when dealing with post declared 
callbacks.
whereas hoisted function statements work in this case.

My opinion on the matter is : use methods.

On Saturday, 17 August 2013 07:53:26 UTC+2, Andrew Kelley wrote:
>
> 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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
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 nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to