max-mapper / callback-hell

information about async javascript programming
http://callbackhell.com
847 stars 100 forks source link

Won't you lose the convenience of lexical scoping when creating first-class functions? #15

Open AnthonyMastrean opened 11 years ago

max-mapper commented 11 years ago

its a tradeoff, relying too heavily on lexical scoping makes things harder to understand and harder to modularize (you cant share lexical scope between modules). a nice side effect of decoupled functions is the explicit interface and lack of magical-seeming shared variables

sometimes its nice to put a function inside another function to take advantage of the lexical scope convenience, but I personally go more than 1 level deep

On Mon, Aug 19, 2013 at 1:33 PM, Anthony Mastrean notifications@github.comwrote:

— Reply to this email directly or view it on GitHubhttps://github.com/maxogden/callback-hell/issues/15 .

AnthonyMastrean commented 11 years ago

Thanks for the comment. I've heard the same elsewhere... it depends!