3 ms·
Erlang is a functional language specially designed (and suitable) for concurrent programming. His rant is partially correct (at best), especially looking at OO
by atlei 18y ago
Erlang is a functional language specially designed (and suitable) for concurrent programming.
His rant is partially correct (at best), especially looking at OOP from a functional programming point of view.
However, developers in the real world who doesn't focus on concurrent programming have different needs.
I'll comment his objections from a C++ perspective (which is a multi-paradigm language, not purely OO):
Objection 1 - Data structure and functions should not be bound together
- you are free to store all your data structures in a single file, and access them from anywhere. However, using classes will let you hide some of the data structures which are not necessary globally, reducing the cognitive load.
Objection 2 - Everything has to be an object
- Not in C++. You use classes where appropriate, and ordinary functions elsewhere. I agree that everything shouldn't be an object.
Objection 3 - In an OOPL data type definitions are spread out all over the place.
- similar to objection 1. You CAN store all definitions in a single include file, but for large projects this can be a LOT of data definitions, where many/most of them are only relevant for parts of the applications. Hiding data definitions in separate classes will make it easier to focus on the RELEVANT data depending on which class/function you use.
Objection 4 - Objects have private state.
- again, similar to 1 and 3. "State is the root of all evil". If you store all data in a single file, then you have one giant global mess. By assigning them to a class, you clearly state the responsibility and scope of the variables. A private state is nobody's business but the class. You don't HAVE to have private state for objects,but then you either need to pass all data to each function, or use global variables instead.
For Erlang (functional programming) these objections make (some) sense since you DON'T want any state whatsoever to facilitate concurrency.
However, saying that OO sucks is stupid, and the four reasons for why OO was popular is not even worth responding to. I don't think functional programming will become more popular due to this rant....