[erlang-questions] Re: OOP in Erlang

Joe Armstrong <>
Sat Aug 14 17:22:56 CEST 2010


On Sat, Aug 14, 2010 at 8:58 AM, Michael Turner
<> wrote:
> "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.)

Erlang was developed in Sweden.

In the Swedish culture self-promotion is considered extremely
bad-manners. It's ok for *other people* to say nice things about your
work, but not for you to do this, which is considered rude.

For a Swede to even mention what they have done something is
considered bad-manners and a violation of "Jantelagen"
http://en.wikipedia.org/wiki/Jante_Law.

Erlang evolved in a Swedish culture and has inherited this behaviour.

In some cultures self-promotion is trained into children from birth,
in Sweden the opposite
is true, children are reprimanded for self-promotion. When adults of
these two cultures
meet cross-cultural confusion can occur.

If somebody from a self-promotion culture meets a Sweden and says
"this stuff I did is amazing"
Swedes tend to literally believe this. Why is this, basically because
Swedes will never say that
what they did is good. If pressed they might admit to having done it
at all (which is their way of
saying it's great) so if they (a Swede) meets somebody who actually
claims to have done something
good they view this as such an exceptional circumstance that it must be true.

They (the Swedes) realize that the person from the other culture is
not bragging and do not apply
Jantelagen to the foreigner but they *overcompensate* - since Swedes
never say that what they did
was great they lack a mechanism for calibrating what this means.

In my experience if somebody from a self-effacing culture says they
did something you should
upgrade the significance of what they did, and if somebody from a
self-promoting culture says
something is great you should down-grade the significance.

Janelagen is essential in understanding how Swedes reason - it is
basically untranslatable.
It really takes about five generations of living here and exchange of
genetic material to understand.

/Joe




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 <>
>>
>> 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 <>
>>
>> > 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