Ready for a dose of theory? We can’t code inheritance unless we know what “inheritance” means. And it mean a different things in OOP-land than it means in prototype-land.
Before discussing ways to implement inheritance, and alternatives for achieving its benefits, we have to define inheritance. As class-based inheritance involves classes, we need to define “classes” with enough rigor so that we can write some code.
When we say “object-oriented programming” or “OOP,” we are not speaking of general programming using objects. We are speaking specifically of programming in a language such as Java or Visual Basic that uses ...