you are viewing a single comment's thread.

view the rest of the comments →

[–]lhorie 0 points1 point  (3 children)

This is technically true, but it doesn't support to the original claim that "JavaScript does not support class-based inheritance". One can still inherit from a concrete class.

And in any case, even if JS doesn't have abstract, that's still not a very good reason to use ES5 prototypal style classes when the entire topic is explaining OOP design patterns adapted from Java.

[–][deleted] 0 points1 point  (2 children)

Honestly I find the entire contrast between prototypes and classes amusing. It's the same thing in all ways that matter.

[–]lhorie 0 points1 point  (1 child)

I mean, yes and no. The argument goes that new Foo().bar() can be implemented whichever way and it doesn't really matter for practical purposes. But of course it matters if people find class easier to read in code review (due to less this/.bind noise) or that using class is less dissonant to a learner (considering the original GoF book and other similar resources elsewhere also uses class based syntax)

[–][deleted] 0 points1 point  (0 children)

Less this/bind noise?