Sujet : Re: What is OOP?
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.c++Date : 29. Mar 2025, 21:36:48
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86a593infj.fsf@linuxsc.com>
References : 1 2 3 4 5
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Mr Flibble <
flibble@reddwarf.jmc.corp> writes:
On Mon, 17 Mar 2025 10:17:51 -0700, Tim Rentsch wrote:
>
ram@zedat.fu-berlin.de (Stefan Ram) writes:
[...]
|Procedural code (code using data structures) makes it easy to |add new
functions without changing the existing data |structures. OO code, on
the other hand, makes it easy to add |new classes without changing
existing functions.
Robert C. Martin
>
|Procedural code makes it hard to add new data structures |because all
the functions must change. OO code makes it hard |to add new functions
because all the classes must change.
Robert C. Martin
>
Both of these comments make the mistake of conflating OOP with
programming in languages that have classes. That isn't what Alan meant
by object-oriented programming. That Smalltalk has classes is
incidental to what is meant by object-oriented programming; classes in
Smalltalk are simply a way of implementing the abstract idea of
"object-oriented programming" that had started in Alan's thinking, and
actually much earlier than Smalltalk or even Simula.
>
Wrong. OOP is:
>
* Encapsulation
* Inheritance
* Polymorphism (including LSP)
* Abstractions
>
The above necessitates the need for classes or similar.
Your view of object-oriented programs is different from Alan Kay's view
of object-oriented programming.