Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, but the problem is that people will still use the new parts too.

I never really liked any of the JS's attempts at OOP, be it the original prototype-based or the newer class-based, but I think that people were sufficiently confused enough by the prototype system that most people didn't bother with it. The class stuff is more approachable, and for some people that can sort of be viewed as a bad thing.



The newer class based IS the original prototype based. Class is literally just syntactic sugar on top of prototype inheritance. It was just added to help people coming from true OOP languages to feel comfortable. Notice, for instance, in Java the class acts as a blueprint for the object. You can’t have the object without the class. Not so in JS. The class is just window dressing and is not required at all.


Most of this seems reasonably on point except for

> true OOP languages

Specifically the Java used as a example isn't exactly a "true OOP language" either; in a sense it's actually a very leaky imperative VM with implementation details like non-object Primitive Data Types and very visible and prominent imperative flow control structures.

Javascript is much closer to an actual "true OOP language" as, unless you're dealing with bad/naive bindings to other stuff in C, it's very hard to even get a handle of a non-object.


Sure, but in practice most people ignore the prototypal features, especially if they're using the "class" keyword, so it may as well not be prototypal. Which is good, because the distinctly prototypal pieces are usually bad behaviors to rely on. The wrong kind of magic.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: