Re:A Case Against Using CoffeeScript
by jashkenas on Wednesday December 14, 2011 @07:43AM
(#3351585)
That works in Python, because Python has a distinction between an "instance" object, and, say, a Dict. In JavaScript an object is an object is an object -- under your proposed change, what would be the value of "this, in this:
[ Parent
| on HN ]
> That works in Python, because Python has a distinction between an "instance" object, and, say, a Dict.
Not really, it's trivial to create a dict-like object which allows access to keys as properties, just override `__getattr__`.
> In JavaScript an object is an object is an object
No, objects can have a non-null [[prototype]] indicating it was created from using `new` on a constructor.
> Klass.prototype.method = options.method;
Depends what `options` is.