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

I may have misunderstood but do you mean that the prototypal class structure is also a mistake? If yes, in which way?


They ended up having to add classes (albeit as syntactic sugar).

Argue its advantages all you want, but I'd say that's representative of what a failure it's been. One of the last languages supporting prototype-based inheritance has basically given up on it.

Personally, I find it an awkward way to try and encapsulate code, generally, it has terrible performance to boot.


> 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.

https://www.reddit.com/r/node/comments/6oqiyn/is_es6_complet...

https://www.reddit.com/r/learnjavascript/comments/6c6use/how...


Was there ever any issues with prototype-based inheritance? I've always assumed that they added classes simply because of stubborn classical-based programmers who couldn't bother to learn JavaScript correctly.


That was my impression as well, especially since the class-ish syntactic sugar doesn’t improve performance either.




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

Search: