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

Prototype-based inheritance seems to be the opposite of what he's arguing for. He's saying it's useful to have data-type hierarchies, but not implementation inheritance.


I don't think so.

"Prototype-based programming is a style of object-oriented programming in which behavior reuse (known as inheritance) is performed via a process of cloning existing objects that serve as prototypes. This model can also be known as prototypal, prototype-oriented, classless, or instance-based programming."

In class based programming you have the fragile base-class problem, as the OP mentioned. Prototype based programming is more powerful and you could emulate class based programming in it (as is done in ES6 with the new "class" syntactic sugar).


I don't see how prototype-based programming solves the fragile base-class problem. Instead you just have the fragile "base-object" problem.




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

Search: