3 ms·
Yes, namespacing is the best currently available option. Unfortunately its only an approximation of lexical scope, as the example in the presentation shows (the
by spion 12y ago
Yes, namespacing is the best currently available option. Unfortunately its only an approximation of lexical scope, as the example in the presentation shows (the one with the two red buttons).
True, this is not something that happens often, and we can mostly get away with namespaces. But that's not the point. The point is that lexical scope is a tried and proven (by years of research, in multiple languages) solution to this problem which doesn't have any of these quirks. And JS has lexical scope.
- talmand 12y agoThe example with the two buttons is inherently flawed and is a bad example. It specifically creates an easily preventable problem in an effort to show a solution to that problem. There is nothing that this library can do that I cannot hand-code in CSS myself. Because it has to generate the CSS that the browser expects to get, which is not hard to do.