On Fri, Nov 18, 2011 at 13:23, Andrew Lunny <[email protected]> wrote: > The discussion, to my mind, isn't AMD vs CommonJS/Node but an explicit > function-for-scope (explicit define) versus an implicit/generated > function-for-scope (generated define). I think scoping is one of the most > important tools a JavaScript programmer has, and hiding it away as > something that gets generated as part of a compile-step muddles the > abstraction layers, and makes programs harder to debug and reason about.
I don't ever remember seeing anyone in Node-land complaining about the hidden boilerplate. The boilerplate is defined here: https://github.com/joyent/node/blob/master/src/node.js#L522 . Can you provide some links to conversations concerning this with Node? Rather, I think Nodesters probably *enjoy* not having to write the boilerplate, and knowing they get a "free" closure-per-file without any ceremony. I know I do. This experience matches other programming languages I've dealt with over the years, which provide some amount of "file private" capabilities (eg, static in C). -- Patrick Mueller http://muellerware.org
