Inheritance Considered Harmful

Mark S. Miller
Fri, 23 Oct 1998 11:15:37 -0700

Ping, I'll have much more to say about it later, but your diagram is
essentially correct.  And pretty cool!  Now about inheritance....

At 01:07 AM 10/23/98 , Ka-Ping Yee wrote:
>... whether taking inheritance out ... an immediate
>put-off to those who assume that a language must have inheritance
>to be truly object-oriented.  

At 08:10 AM 10/23/98 , Douglas Crockford wrote:
>So, I think the question is not "Is inheritance evil?" for I have correctly
>answered that question: It is. Instead we should be asking: "Does
>inheritance increase or diminish E's chances of success?"

I've now read through this thread.  When I started, I was initially very
skeptical of getting rid of inheritance for exactly this reason.  However,
Doug raises an interesting point:

At 08:10 AM 10/23/98 , Douglas Crockford wrote:
>My hunch is that E will be more successful without inheritance. Mark has
>targeted an audience of scripting-language users, folks who generally do 
>not use inheritance, and so might enjoy a simpler language.

though Ping observes:

At 01:07 AM 10/23/98 , Ka-Ping Yee wrote:
>I can bet that if E is presented as
>not having inheritance, some lists of scripting languages will point
>out "but it has no inheritance" as some sort of deficiency (i've
>seen such feature-comparison lists) which may bother some.

I don't really know the C-syntax tradition scripting language world that
I'm trying to appeal to.  I'm encouraged that VB-folks shun inheritance.
C++ers, as Jon indicates, have a hugely negative experience of it, and
might welcome a language that doesn't have it.  Both weakly-typed
Smalltalkers and strongly-typed Javaheads --- including myself -- have a
generally positive experience of single inheritance used lightly (hereafter
SIUL).  If they were my prime audience, I'd have a real problem getting rid
of it, and the Javaheads may actually be my prime audience.

But, as Doug speculates, the C-syntax tradition object-oriented scripting
language folks may be.  Do Python and/or Perl5 have inheritance?

Btw, I understand and mostly agree with all the abstract arguments about
why inheritance is evil.  However, as a programmer, in every language in
which I've programmed in a SUIL style -- including Joule! -- I've found it
pleasant.  Joule actually supports something weaker than standard SUIL
(inheritance of behavior but not state), and we were surprised to find
ourselves wanting the missing piece -- despite the fact that Joule's
support for delegation is as good as E's (because E stole these ideas from

Dean was the one that ran into the rude surprise.  Perhaps we can get him
to comment?????  (please please please)

Since my preference is to err on the side of being too simple, until this
issue is resolved, E's inheritance support sugar (the "class" construct) is
hereby removed from the language spec.  The documentation will show the
inheritance-by-delegation pattern merely as an example delegation pattern.

	Without inheritance, but still paying the syntax and the vat,