Hacker News new | ask | show | jobs
by Veedrac 4063 days ago
Whilst I am not an OO fan per se, I found a lot of these objections quite weak.

-- Objection 1 --

Nobody claimed that functions and data structures are the same thing. However, I still keep my toothpaste with my toothbrush. You have not explained why keeping them together is bad, except for the suggestion that different things should not be put together.

As an example of different things that should be kept together, I suggest functions and their type specification.

-- Objection 2 --

You have not stated what's better about the Erlang approach, just that it is different. As it stands I can reverse the wording and it means largely the same thing:

""" Consider "time". In a non OO language "time" hat to be an instance of a data type. But in an OO language "time" is an object. For example, in <OO Language> there are lots of different varieties of time, these can be clearly and unambiguously specified using class declarations, as follows:

<code>

Note that these definitions do not belong to any particular data type. they are ubiquitous and objects representing times can be manipulated by any function in the system.

There are associated methods. """

-- Objection 3 --

"In an OOPL data type definitions belong to objects. So I can't find all the data type definition in one place."

Although I agree with you, there is the converse that in a non OO language the reverse is true. Why is one better than the other?

"As lisp programmers have know for a long time"

That's an argument to authority. Why do they belive that?

"A ubiquitous data structure is something like a linked list"

A good number of OO fans would criticize you for saying that.

"In an OOPL I have to choose some base object in which I will define the ubiquitous data structure, all other objects that want to use this data structure must inherit this object."

This is false. Although inheritance is a decidedly OO tool, it is not the be-all and end-all of OO. Have you really never seen a Java List as a member or local variable?

-- Objection 4 --

"Pure declarative languages say that there is no state."

This isn't true. What would you say a datatype is, if not state? All these languages do is separate state, not remove it.

"The "hide the state from the programmer" option chosen by OOPLs is the worse possible choice."

Why? Again, you have asserted something to be true that an OO advocate would disagree on. This makes for a weak argument.