Minification considerations aside (where compression should help), that point 
seems to be highly controversial: I, for one, much prefer `this` to any kind of 
shorthand. The brain works with tokens, so grawlix and words have similar 
cognitive load. Even for private names, I’d rather have regularity via 
this.@privateName than terseness.

Obviously, mine is just one opinion among many, but not everyone wants `this` 
gone. The .{ operator or some variant of it should also help with verbosity.


On Mar 14, 2012, at 16:27 , Kevin Smith wrote:

> One thing that has come up in my number crunching is the repetition of the 
> character sequence "this.".  If we allowed @ (ala CoffeeScript) as a 
> shorthand for "this.", then we could, if nothing else, shave perhaps 1-3% off 
> of the size of minified code.
> 
> Other advantages:
> 
> - A pain point for doing OO programming in javascript is the required "this" 
> repetition.  A shorthand would alleviate that pain.
> - If private names are allowed as the "name" in @name, then we would have a 
> concise syntax for private "member" access. 
> 
> See this example. (This example describes a hypothetical class syntax, which 
> I'm not proposing in this thread.  But it does illustrate the @name concept.)

-- 
Dr. Axel Rauschmayer
[email protected]

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

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to