Sep 27 meeting notes
Bob Nystrom
rnystrom at google.com
Fri Sep 30 12:51:56 PDT 2011
On Fri, Sep 30, 2011 at 11:53 AM, Brendan Eich <brendan at mozilla.com> wrote:
> 1. Oliver and others *do* want x and y to be in scope somehow. They can't
> be via the |this| parameter object on the scope chain, though. That's
> dynamic scope (the prototype is extensible, or *a* prototype, possibly
> Object.prototype, is). But the desire to avoid this. prefixing is natural
> and predictable for people coming from C++, Java, etc. Should we consider
> supporting this expectation somehow, rather than steering people away from
> it with less natural syntax?
>
When I first started using JS heavily, having to type this. everywhere drove
me up the wall. Now I love it. It's definitely more verbose (and I really
like CoffeeScript's answer here) but I think it's worth it to have a clear
distinction between variables in lexical scope and properties of objects.
When I went back to Java from JS, I found *not* having to do this. felt
weird and magical. I think it works OK in a static language, but I'm not
sure if it's asking for trouble in a dynamic one.
> My question for everyone: will users expect declared property names to be
> in-scope, no matter what the syntax for declaring or defining them is? I
> suspect so, and that makes me think we're not going to do well by
> "counter-steering" with object literal property init syntax.
>
I'd like to hope not. Aside from the now dead with, I didn't think there
were any places in the language where properties were in scope now, so I
don't know if they would expect that to change.
- bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110930/1893b2f4/attachment.html>
More information about the es-discuss
mailing list