Some questions about Private Name Objects
Erik Arvidsson
erik.arvidsson at gmail.com
Thu Sep 13 09:09:56 PDT 2012
On Thu, Sep 13, 2012 at 8:37 AM, Kevin Smith <khs4473 at gmail.com> wrote:
> 1) Is method name-collision a practical problem, or just a theoretical
> problem? If it's just a theoretical problem, then we don't need unique
> names, and in teaching the language we can simply guide users away from
> trying to create "private methods". In fact, without supporting syntax it's
> unlikely that users would even bother trying to create them in the first
> place.
Yes. This is a real problem.
It is a common problem that we see a lot with "private" members using
naming conventions.
class Base {
constructor() {
this._element = ...;
}
}
class Derived extends Base {
constructor() {
this._element = ...; // OOPS!
}
}
--
erik
More information about the es-discuss
mailing list