You are viewing a single comment's thread from:

RE: JavaScript Basics: Object.freeze and Object.isFrozen

in #javascript8 years ago (edited)

I don't actually think it's a lot of people. I think it's a vocal minority. And it turns out that the most vocal, such as Mattias and Elliott, don't actually understand classes, inheritance or composition nearly as well as they think they do here is last prog which i tried.
class Person {}

// A student IS-A person; inheritance seems reasonable class Student extends Person {}

// An employee IS-A person; inheritance seems reasonable class Employee extends Person {}

// Oops. What if someone is *both* a student and an employee?~// If we're in a language that allows only single inheritance, then we're just sunk// And even if we're in a language that allows multiple inheritance,
// we may run into ambiguity issues since we've inherited Person twice
class StudentEmployee extends Student, Employee {} ???` @ghasemkiani