shortcuts for defining block-local private names, plays nicely with @foo syntax

François REMY fremycompany_pub at yahoo.fr
Mon Jan 23 01:41:21 PST 2012


Just to confirm: you are not alone. I always thought that allowing to imply local this (‘this.’) was a bad idea (C#). Seriously, this is not 5 chars that’ll hurt but it could make IDE work a lot easier, and it make code reuse more efficient (if you need to copy/paste some code, if you stay in the same class, it will work as intended, not if a function argument can override the class field). It also brings symetry to the code (this.a==other.a).
From: Axel Rauschmayer 
Sent: Monday, January 23, 2012 10:26 AM
To: Brendan Eich 
Cc: ECMAScript discussion 
Subject: Re: shortcuts for defining block-local private names,plays nicely with @foo syntax

    function Point(everyone, secret) {

      .everyone = everyone;


  You're requiring manual semicolon insertion before lines like this. Consciously?


Sight. Right. Not a good idea, then.

An important consideration is that eliminating `this` will increase the grawlix-factor of JavaScript (I always liked the explicit `this`, especially compared to Java).

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com




--------------------------------------------------------------------------------
_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120123/9eab70c6/attachment.html>


More information about the es-discuss mailing list