2 ms·
OOP in the sense of encapsulation, inheritance, polymorphism is an academic exercise for students to think about organization of data and functions into hierarc
by snidane 6y ago
OOP in the sense of encapsulation, inheritance, polymorphism is an academic exercise for students to think about organization of data and functions into hierarchies. Objects in this case were mistaken for modules. This is only usable by students and librarians.
OOP in sense of message passing is just a programming language implementatiin technique used in Smalltalk which lets you handle functions of multiple arguments with ease. You basically 'pass' each argument as a message to the receiving object.
That is obviously just a hack to make that feature of nontrivial function call work. Real message passing obviously has to be asynchronous to even resemble concept of real life message passing. Erlang and Actor model in that case are pure models of message passing based OOP.
Somehow all of these OOP systems are just distractions from solving problems using computers because you can represent your problem using pure 'data' such as numbers or strings and composing them to bigger structures with well defined operations - such as lists, dicts and tables and so on. Objects can be purely abstract thing in your mind or documented in code comments.
Imperative programming obviously doesn't scale beyond one machine because of von Neumann bottleneck and suffers from unmanageable global state. That doesn't mean OOP is the solution.
Functional programming is of two kinds - statically typed with powerful type systems - which are systems with very limited field of use and high development cost. Unfortunately unusable for real life problems because of lack of intuition.
Other less strict functional languages fare better, but used naively suffer from von Neumann bottleneck too. Unless they are used in a language oriented programming paradigm, whereby you use your language only to construct a higher level language DSL) which can abstract over more than just a single machine.
Good examples are Lisps and their ability to define other languages such as Prolog or SQL or Linq.
The only way to make parallel computing possible is to use data parallelism instead of task parallelism so data oriented languages such as sql or datalog are the future since Moore's law reached its end. This poses a strong constraint on design od programming languages.
SQL, while not suffering from single processor bottleneck, unfortunately sucks as a language because it is not programmable and nondeterministic in generating physical plans.
Which offers a great opportunity for programming language enthusiasts - build a programmable sql or datalog like language because other paradigms reached some fundamental constraints and hit a dead end.
Or come up with a new paradigm.