News for hackers. Stuff that matters.
Re:JavaScript: prototype vs. class by lucideer on Wednesday April 04, 2018 @11:43AM (#16755786)
Agree on class fields but there's high demand. I haven't examined the exact detail but it seems hard to please both sides here. Not sure what the best way forward is.

On .bind(this), that's exactly what I meant by keeping the old system. "Fixing" that magically would have required underlying changes. That said, since you brought up class fields and bind in the same post, there's always:

    class Dog {
      bark() { console.log('Bark!'); }
      eat = (food) => console.log('Munch');
    }

    feedDog(dog.eat);
Re:JavaScript: prototype vs. class by 52-6F-62 on Wednesday April 04, 2018 @12:25PM (#16756254)
My favourite solution so far is the @autobind decorator. It's far from native yet, though. And of course, enters the newer decorators feature which drifts ever closer to Java-like syntax to some peoples' chagrin.

https://github.com/andreypopp/autobind-decorator

Re:JavaScript: prototype vs. class by dmitriid on Wednesday April 04, 2018 @11:58AM (#16755959)
True, and that's what people use extensively. Class fields break `extends` though :)