[E-Lang] inheritance, delegation, mental models for beginners (was: down with `define' (was: newbie syntax: picayune points from a prejudiced programmer))
zooko@zooko.com
zooko@zooko.com
Fri, 02 Mar 2001 09:29:43 -0800
[Cc:'ing correspondents, the e-lang list, and Dworkin, described
below.]
I have not yet read the _E_in_a_Walnut_ section about objects and
functions. (But I am fairly sophisticated about object models,
delegation vs. inheritance, functional programming languages, etc.
compared to the average Java programmer.)
There are two consecutive hurdles here to getting new programmers into
E.
The first hurdle is passed by the time they read _EiaWalnut_. The
first hurdle happens during casual web browsing, word-of-mouth among
hackers, inaccurate generalizations that get to be the top story on
slashdot, etc.
If you don't have a way to create classes that is "atomic" from the
perspective of a newbie programmer (i.e., he needn't understand any
lower-level semantics in order to read and write it), then, a
substantial number of defensive Java advocates will say "E isn't object
oriented -- it doesn't even have classes or inheritance!".
Occasionally there will be a more learned person around to contradict
that person, but in many cases that assertion will go unanswered and
will form a good part of the conventional wisdom about E, among people
who have never looked at _EiaWalnut_.
The second hurdle is when someone is reading _EiaWalnut_. What they
think at that time about "how easy it is to define classes, create
objects of that class, and create subclasses which re-use the code from
other classes" will be a major factor in determing whether they
continue, as well as what information about E leaks back from them to
the mass of chatterers described in the paragraph above.
Note that I haven't read the chapter in question, which makes my
opinion about the importance of "defining classes, creating objects of
classes, and creating subclasses which re-use code from other classes"
somewhat under-informed, which is my point. :-)
By the way, there may be an "out" on the subject of inheritance. The
MUD programming languages [1] descended from `lpC' use the word
"inheritance" to mean the thing that we call "delegation". I would
consider it valid to provide a delegation mechanism in E and call it
"inheritance". Since E is dynamically typed there is no really
important difference, is there? [2]
Regards,
Zooko
[1] These languages (or at least the one implemented by my friend
Dworkin) are dynamic, object-based (not class-based) languages with
orthogonal persistence, mutually untrusting coders, and a non-stop
runtime... This means among other interesting consequences that it
does dynamic update of the code for running objects.
http://dworkin.nl/
[2] I might feel stupid when I hear your answer to that question, but
for Nth time I remind myself that input from a newbie can be valuable
in E's current state.