callback-hell icon indicating copy to clipboard operation
callback-hell copied to clipboard

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

Open AnthonyMastrean opened this issue 11 years ago • 2 comments

AnthonyMastrean avatar Aug 19 '13 20:08 AnthonyMastrean

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 [email protected]:

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

max-mapper avatar Aug 19 '13 20:08 max-mapper

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

AnthonyMastrean avatar Aug 19 '13 21:08 AnthonyMastrean