Hacker News new | ask | show | jobs
by robee 5569 days ago
Object Oriented programming exists because it is how humans conceptualize the world around them. Humans think in objects and actions on, in and between objects. OOP is a translation of natural thinking into systems and behaviors. Why is this a bad thing, especially for learning?

I guess my question is, why does OOP and an natural translation between the real world and the code world lead to this discussion and a certain level of condescension around utilizing the concepts of OOP?

3 comments

The way humans conceptualize the world is miles away from how computers work. We (or at least I) conceptualize the world in terms of relationships between things we encounter, but the focus of OOP is designing individual classes and their hierarchies.

But note that, in everyday life, relationships exist mostly between objects that would have been instances of unrelated classes in OOP. For example, my SCREEN IS ON TOP of the TABLE; I (a human being) AM SITTING on a CHAIR; a CAR IS ON the ROAD; I am TYPING on THE KEYBOARD; the COFFEE MACHINE BOILS WATER.

We think in terms of bivalent (sometimes trivalent, as, for example in, "I gave you flowers") verbs where the verb is the action (relation) that operates on two objects to produce some result/action. Contrast that with OOP where you first have to find one object and tell it to perform some action on another object. The way of thinking is shifted from actions/verbs operating on nouns to nouns operating on nouns, which is highly unnatural for me. It is as if everything is being said in passive voice, e.g., "the keyboard is being typed on by me".

I'm not sure that's true. In OOP, a methods belong to objects. In a natural language, a verbs don't really belong to nouns. To me, the structure of OOP is very different to how people typically think.
Why don't you use Erlang? Its much closer to you definition of OOP.
Exactly.

And I think that Erlang is most closest to Kay's definition of OOP. (If we can drop "Everything is object")

Erlang processes are objects.