You Don't Know Inheritance September 11th, 2014
Recently I discovered Kyle Simpson's (@getify) spectacular book series, You Don't Know JS. It's a sequence of books being written entirely on github and physically published by O'Reilly. The books are licensed CC-NC-ND and free to read online, but you should buy them anyway just because they're really good. That said, I have an issue of semantics that's been bugging me, and I need to get it off my chest.
In chapter 5 of "
this & Prototypes", Kyle states the following fact:
In class-oriented languages, multiple copies (aka, "instances") of a class can be made, like stamping something out from a mold. As we saw in Chapter 4, this happens because the process of instantiating (or inheriting from) a class means, "copy the behavior plan from that class into a physical object", and this is done again for each new instance.
Further on in this chapter, under "What's In A Name" he uses this to re-enforce this point:
This mechanism is often called "prototypal inheritance" (we'll explore the code in detail shortly), which is commonly said to be the dynamic-language version of "classical inheritance". It's an attempt to piggy-back on the common understanding of what "inheritance" means in the class-oriented world, but tweak (read: pave over) the understood semantics, to fit dynamic scripting.
The word "inheritance" does not actually imply a copy operation.
Now, one could argue that Kyle is referring to inheritance as the transmission of genetic traits. This definition has only come into use in the last century and isn't even listed in Merriam-Webster's main definition (if you scroll down the page it shows up under the Medical dictionary, but says nothing of duplication). The oxford definition of inherit does include genetic traits in the main definition, but also makes no mention of duplication. Genetic inheritance is not, in fact, a perfect duplication of traits. Both ova and spermatozoa only contain half of the parent's chromosomes, and due to epigenetic drift, that which the child receives is rarely a perfect copy.
Therefore, "prototypical inheritance" is in fact the more syntactically accurate term.