TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Heart and Soul of Prototypal OO: Concatenative Inheritance

21 pointsby ericelliottover 9 years ago

4 comments

vmorgulisover 9 years ago
Looks like mixins:<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mixin" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mixin</a>
panicover 9 years ago
This &quot;concatenative inheritance&quot; seems like a symptom of JavaScript&#x27;s limited support for prototypal OO. Objects in Self support multiple prototype slots: you can add to an object without copying more stuff into it.
评论 #10966400 未加载
评论 #10966869 未加载
Kiroover 9 years ago
&gt; Believe it or not, it is the most commonly used form of inheritance in JavaScript.<p>Are extend, assign etc really more common than just working with prototypes? I&#x27;ve personally never used it but written a lot of OO code using prototype delegation.
评论 #10966692 未加载
plumaover 9 years ago
That&#x27;s a pretty grandiose term for a pretty straightforward pattern in JS. Other people just call it &quot;mixins&quot; but I guess there is some elaborate academic argument for why that&#x27;s an entirely different concept even if the two are indistinguishable to the layperson.