Sujet : Re: logically weird loop
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.cDate : 05. Dec 2024, 16:06:22
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <visfhf$1m5v7$1@dont-email.me>
References : 1 2 3 4 5 6 7 8
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 05/12/2024 12:21, Janis Papanagnou wrote:
On 05.12.2024 04:53, Tim Rentsch wrote:
>
Almost everyone who took Simula and C++ as the archetype for OOP
never understood it.
LOL.
(Funny [dogmatic] statement, without any substance again.)
If you take the position that Alan Key, as the person who is credited with inventing the term "object oriented programming", gets to make the definition of what OOP is, then Tim's statement is accurate. Originally OOP meant something very different from how it is interpreted in C++. (I don't know Simula except by reputation, so I can't comment on that.)
The original idea of OOP was to have self-contained "objects" that communicated only by passing messages. If object A wanted object B to do "foo", it would not call "B.foo()" in its own context, as is done in C++. Instead, it would pass a message "foo" to B. What B does with it, and when, is up to B. If a return value is expected, then B will send a message with the answer back to A.
This is, I think, akin to the modern "actor" programming paradigm, and it has connections back to Hoare's CSP (which has inspired many systems and languages, most recently Golang). It gives you a robust, modular system with great scalability - objects can run on different cores or threads, or different computers connected by a network. Data races and other concurrency issues are pretty much impossible. Different parts of the program could be changed at run-time.
Of course, all this has significant overheads - it is not suitable for a low-level high efficiency language. The rather different idea of OOP represented by languages like C++ can be very much more efficient, which is why it caught on.
Perhaps the language that is most true to the original idea is Erlang, with its "write once, run forever" motto.