The issue we complain about in JavaScript is one like this: class C { handleEvent() {} someMethod() { onEvent(this.handleEvent); // bad; "this" lost onEvent(this.handleEvent.bind(this); // ok } } C++ requires the same…
In C++ you have to use bind too.
On the contrary, classes and inheritance in both Python and JavaScript behave basically the same. In Python, classes are objects (a building, not a blueprint), and inheritance is done by delegation.…
> One of the last languages supporting prototype-based inheritance... Actually, all this time, both Python and Ruby use what we would call prototype-based inheritance.…
Beware referencing or learning from Eric Elliott. https://www.reddit.com/r/javascript/comments/6q2lk0/why_comp... https://www.reddit.com/r/javascript/comments/5c5lkq/what_eri...…
The issue we complain about in JavaScript is one like this: class C { handleEvent() {} someMethod() { onEvent(this.handleEvent); // bad; "this" lost onEvent(this.handleEvent.bind(this); // ok } } C++ requires the same…
In C++ you have to use bind too.
On the contrary, classes and inheritance in both Python and JavaScript behave basically the same. In Python, classes are objects (a building, not a blueprint), and inheritance is done by delegation.…
> One of the last languages supporting prototype-based inheritance... Actually, all this time, both Python and Ruby use what we would call prototype-based inheritance.…
Beware referencing or learning from Eric Elliott. https://www.reddit.com/r/javascript/comments/6q2lk0/why_comp... https://www.reddit.com/r/javascript/comments/5c5lkq/what_eri...…