[erlang-questions] Re: OOP in Erlang

Michael Turner michael.eugene.turner@REDACTED
Sat Aug 14 08:58:04 CEST 2010


"The inheritance concept, on the other hand is crucial to OO design; not
so much for the  inherited functionality as for type polymorphism.
 Other languages provide this using algebraic data types and other
distinguished unions, but in OO we work with classes, and we need
polymorphic types to avoid the deluge of conditionals that we would see
otherwise."

With all due respect, when I boiled this paragraph down to its essentials,
it read to me like this: "The definition of 'object-oriented design' entails
inheritance, because that's the way 'object-oriented' was defined."

There's a particularly strenuous force-fitting of this definition in one of
the comments on that Alan Kay interview -- it's first admitted that Alan Kay
coined the term and contributed a lot of ideas, but then flatly asserted
that object-orientation was defined by the architects of Simula -- even
though Simula 67 lacked encapsulation (no class variables, even -- you had
to use globals) and even though Simula 67's treatments of types and
inheritance probably doesn't meet some people's definitions of polymorphism.

There's a Humpty Dumpty feeling about a lot of these debates.  ISTR a
similar one, almost two decades ago, about whether C++ was truly
"polymorphic" despite being strongly typed.  It turned out that
"polymorphic" had come to mean different things to different people, that
there was no hard-and-fast formal definition.  Whether you were going to
"win" such arguments often depended on your staying power in debate.

I think the Erlang community would do itself a world of good by finding
somebody to go knock on Alan Kay's door in Glendale and spend 15 minutes
with him showing how Erlang does things.  As far as I can tell, he's never
said anything about the language.  (Perhaps because he's hardly heard of it.
 After all, if there's one thing the Erlang community seems dismayingly bad
at, it's self-promotion.)  If Alan Kay said, "Erlang looks like almost what
I've been talking about since the mid-60s, I wonder how I missed it for so
many years?" I think some of you might be surprised by how many highly
influential people in the programming world would sit up and take notice.

-michael turner

2010/8/14 Dave Smith <dave.smith.to@REDACTED>

> Yes I agree,  The lack of isolation is where the the big names of OOP went
> wrong; the likes of C++, Java, C# and JavaScript provide ways for state to
> 'leak out' of objects by means of pointers and references.  What good is
> encapsulation if member variables are bound to shared objects.  One can
> avoid this problem  if he goes our of his way, but in practice, this is
> rarely done.  Strict encapsulation should be the rule, not an options.
> Arguing that encapsulation is a virtue with respect to these languages
> seems
> very shallow indeed.
>
>  Respectfully, I would not go as far as Joe to say that OO is a poor
> paradigm for modelling real world applications, as I've heard him argue in
> the past.  I've made a career out of object modelling and writing software
> in  C++ and Java -- it's very much the way I approach software design.
>
> The inheritance concept, on the other hand is crucial to OO design; not so
> much for the  inherited functionality as for type polymorphism.  Other
> languages provide this using algebraic data types and other distinguished
> unions, but in OO we work with classes, and we need polymorphic types to
> avoid the deluge of conditionals that we would see otherwise.
>
> --DS
>
>
> 2010/8/13 Joe Armstrong <erlang@REDACTED>
>
> > ery much an OOPL - since deep down, very
> > deep down, it tries to make makes a passable job of getting message
> > passing and isolation right.  In this sense it is far more OO than
> > languages like Java (etc.) that have no notion of isolation and thus
> > cannot be considered OO
> >
>


More information about the erlang-questions mailing list