<story><title>The Object Model of Self</title><url>https://github.com/pavel-krivanek/articles/tree/master/SelfObjectModel</url></story><parent_chain><item><author>artemonster</author><text>Really nice explanation. Having read almost all papers on this endless debate &amp;quot;Classes vs Prototypes&amp;quot; you&amp;#x27;d get a feeling that prototype-based object system wins in any aspects (expressiveness, flexibility, whatever), and yet almost all prototype-based languages in the end include crude class implementations (as Class for a signle namespace to contain all related traits, constructor method and&amp;#x2F;or prototypical instance for cloning) - interesting, why so? Is this model ingrained in our brains by our education or we do really think that way (i.e. with sets of related entities).</text></item></parent_chain><comment><author>Symmetry</author><text>Classes are less flexible so they&amp;#x27;re easier for programmers to reason about.  That makes them better in any situation where you don&amp;#x27;t need that extra flexibility, which is most of them.</text></comment>
<story><title>The Object Model of Self</title><url>https://github.com/pavel-krivanek/articles/tree/master/SelfObjectModel</url></story><parent_chain><item><author>artemonster</author><text>Really nice explanation. Having read almost all papers on this endless debate &amp;quot;Classes vs Prototypes&amp;quot; you&amp;#x27;d get a feeling that prototype-based object system wins in any aspects (expressiveness, flexibility, whatever), and yet almost all prototype-based languages in the end include crude class implementations (as Class for a signle namespace to contain all related traits, constructor method and&amp;#x2F;or prototypical instance for cloning) - interesting, why so? Is this model ingrained in our brains by our education or we do really think that way (i.e. with sets of related entities).</text></item></parent_chain><comment><author>Someone</author><text>&lt;i&gt;”wins in any aspects (expressiveness, flexibility, whatever)”&lt;/i&gt;&lt;p&gt;One ‘whatever’ where it doesn’t win is in robustness. Code will make assumptions about various kinds of animal and fail when meeting a sheep with 5 legs, or a pig that can fly.&lt;p&gt;You can solve that by testing for capabilities, but you would have to do that in many places, and make sure to cover all of them.&lt;p&gt;And yes, that comes at the cost of flexibility. Your class model won’t support flying pigs until you consciously add such support.</text></comment>