[erlang-questions] OOP in Erlang

Hynek Vychodil hynek@REDACTED
Wed Aug 11 17:57:30 CEST 2010


On Wed, Aug 11, 2010 at 1:04 PM, Ed Keith <e_d_k@REDACTED> wrote:
> --- On Wed, 8/11/10, Hynek Vychodil <hynek@REDACTED> wrote:
>
>> From: Hynek Vychodil <hynek@REDACTED>
>> Subject: Re: [erlang-questions] OOP in Erlang
>> To: "Guy Wiener" <wiener.guy@REDACTED>
>> Cc: "Erlang Questions" <erlang-questions@REDACTED>
>> Date: Wednesday, August 11, 2010, 4:37 AM
>> On Wed, Aug 11, 2010 at 9:44 AM, Guy
>> Wiener <wiener.guy@REDACTED>
>> wrote:
>> > I have to stand up for OOP at this point: OOP does not
>> start and end with
>> > "encapsulating code and data". The OOP feature that
>> has the strongest impact
>> > on code brevity is *inheritance*. Thus, the interest
>> in extending modules.
>>
>> I can't agree with you. Inheritance is only way how some
>> OOP language
>> copes with complexity of OO systems. Inheritance is neither
>> core nor
>> mandatory feature of OOP. What worse, many of OO affected
>> people what
>> I met stated that inheritance is most controversial and
>> mostly misused
>> feature of OOP. I also observe that there is positive
>> correlation with
>> person experience and probability that will tell or agree
>> with above
>> statement.
>>
>> >
>> > Also, IMHO, parameterized modules are a more compact
>> way to encapsulate code
>> > and data, since that you don't have to pass the data
>> structure around as an
>> > explicit state (assuming, of course, that the data is
>> immutable).
>> >
>> > Guy
>> >
>> >
>> > On Wed, Aug 11, 2010 at 5:17 AM, Ngoc Dao <ngocdaothanh@REDACTED>
>> wrote:
>> >
>> >> The mostly used feature of OOP is probably
>> encapsulating code and
>> >> data. Have a look at gen_server:
>> >> http://www.erlang.org/doc/man/gen_server.html
>> >>
>> >>
>
>
> When I first studied OOP, in 1990, I was taught that OO was defined by four features: Encapsulation, Abstraction, Inheritance, and Polymorphism. That if any of these were missing it was not OO.

Same to me. It was in all books what I read in 1990s and it is still
in many books. But I learnt that not all what they taught me and not
all what is written in books is true.

http://en.wikipedia.org/wiki/Object-oriented_programming#History

Starts from 1960 through 1970s when "The Smalltalk language, which was
developed at Xerox PARC (by Alan Kay and others) in the 1970s,
introduced the term object-oriented programming to represent the
pervasive use of objects and messages as the basis for computation."

Smalltalk contains inheritance but Alan Kay doesn't state that
inheritance is key feature of OOP. Especially in these days he is
telling something different. (For example:
http://www.google.co.uk/search?q=alan+kay+message+passing)

>
>      -EdK
>
> Ed Keith
> e_d_k@REDACTED
>
> Blog: edkeith.blogspot.com
>
>
>
>
>
>
>



-- 
--Hynek (Pichi) Vychodil

Analyze your data in minutes. Share your insights instantly. Thrill
your boss.  Be a data hero!
Try GoodData now for free: www.gooddata.com


More information about the erlang-questions mailing list