A shorthand for Object.defineProperty?

Axel Rauschmayer axel at rauschma.de
Tue Jun 21 11:39:03 PDT 2011


>> This would make things easier to understand. When I explain this aspect of JavaScript to others, they are often stumped, but I have never encountered anyone who was confused by Python:
>> class MyClass:
>>     def mymethod(self):
>>         return "hello world"
>> def myfunction():
>>     return "hello world"
>> 
>> So this is probably my real point: can we make things as un-confusing as in Python?
> 
> Python has its confusing parts too.

Yes, I only meant when it comes to functions versus methods.

> Explaining things to beginners still will involve explaining 'function' (long-form) syntax for the foreseeable future, so you don't gain anything by crippling arrow syntax.
> 
> But once beginners learn more, they will hate having to write out the long form for all the dynamic this cases that can't be written using method-in-initialiser syntax.


Agreed. If a simplification could be done naturally, that would be great. But as that seems impossible, forcing things does not make sense.

-- 
Dr. Axel Rauschmayer

axel at rauschma.de
twitter.com/rauschma

home: rauschma.de
blog: 2ality.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110621/4c39687c/attachment-0001.html>


More information about the es-discuss mailing list