Path: news.eternal-september.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: wij Newsgroups: comp.lang.c++ Subject: Re: What is OOP? Date: Tue, 03 Dec 2024 18:38:52 +0800 Organization: A noiseless patient Spider Lines: 95 Message-ID: References: <86frn6og85.fsf@linuxsc.com> <853d65692ada3865dafc2c6010539ed20e4e348c.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Date: Tue, 03 Dec 2024 11:38:53 +0100 (CET) Injection-Info: dont-email.me; posting-host="a914f74ad38b4c98d46f4408245671b3"; logging-data="15973"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6zK6YtaAURttE9NyCapHE" User-Agent: Evolution 3.50.2 (3.50.2-1.fc39) Cancel-Lock: sha1:wI6K51NB4j603JnVC94Tm4E6py0= In-Reply-To: On Mon, 2024-12-02 at 14:59 -0800, Chris M. Thomasson wrote: > On 12/2/2024 12:49 AM, wij wrote: > > On Sun, 2024-12-01 at 20:34 -0800, Tim Rentsch wrote: > > > wij writes: > > >=20 > > > In response to the question of the subject line... > > >=20 > > > Just because a program is being written in a language that has > > > functions doesn't mean that what is being done is functional > > > programming. > > >=20 > > > Just because a program is being written in a language that has > > > classes and objects doesn't mean that what is being done is > > > object-oriented programming. > > >=20 > > > More than anything else object-oriented programming is a mindset > > > or a programming methodology.=C2=A0 It helps if the language being > > > used supports classes, etc, but the methodology can be used even > > > in languages that don't have them. > > >=20 > > > A quote: > > >=20 > > > =C2=A0=C2=A0=C2=A0=C2=A0 My guess is that object-oriented programming= will be in the > > > =C2=A0=C2=A0=C2=A0=C2=A0 1980s what structured programming was in the= 1970s. > > > =C2=A0=C2=A0=C2=A0=C2=A0 Everyone will be in favor of it.=C2=A0 Every= manufacturer will > > > =C2=A0=C2=A0=C2=A0=C2=A0 promote his products as supporting it.=C2=A0= Every manager will > > > =C2=A0=C2=A0=C2=A0=C2=A0 pay lip service to it.=C2=A0 Every programme= r will practice it > > > =C2=A0=C2=A0=C2=A0=C2=A0 (differently).=C2=A0 And no one will know ju= st what it is. > > >=20 > > > That paragraph is taken from a paper written more than 40 years > > > ago.=C2=A0 The prediction came true with a vengeance, even more than > > > the author expected.=C2=A0 Most of what has been written about object > > > oriented programming was done by people who didn't understand it. > > >=20 > > > Two more quotes, these from Alan Kay: > > >=20 > > > =C2=A0=C2=A0=C2=A0=C2=A0 I invented the term "Object Oriented Program= ming," and C++ > > > =C2=A0=C2=A0=C2=A0=C2=A0 is not what I had in mind. > > >=20 > > > =C2=A0=C2=A0=C2=A0=C2=A0 Though Smalltalk's structure allows the tech= nique now known > > > =C2=A0=C2=A0=C2=A0=C2=A0 as data abstraction to be easily (and more g= enerally) > > > =C2=A0=C2=A0=C2=A0=C2=A0 employed, the entire thrust of its design ha= s been to > > > =C2=A0=C2=A0=C2=A0=C2=A0 supersede the concept of data and procedures= entirely;=C2=A0 to > > > =C2=A0=C2=A0=C2=A0=C2=A0 replace these with the more generally useful= notions of > > > =C2=A0=C2=A0=C2=A0=C2=A0 activity, communication, and inheritance. > >=20 > > Thanks for those information (I did not particularly study 'OOP'). > > =C2=A0From my >20 years of practice, I would say the object+action mode= l > > works nearly perfectly. Particularly it is the same idea with > > abstract algebra. IOW, OOP is programming abstract algebra for > > general problems. > > I recently read a book (translation version) > > https://www.amazon.com/Mind-Motion-Action-Shapes-Thought/dp/046509306X > > OO is probably also how our brain works. So, yes, we don't absolutely n= eed OO > > language to program in OO, OO is natural (thou C++ is very suitable. An= d, there > > may be other kind of good programming model). > >=20 > > Note: A point in 'the' inheritance theory of OO is seriously false. > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 I can't say it right now, it is ab= out inherited class has to delete > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 inherited member. > >=20 >=20 > Have you ever messed around with cohort scheduling? Not sure why I am=20 > thinking of that now after reading your response. Humm... >=20 > https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-20= 01-39.pdf Just like the reason libwy uses POSIX API, mostly, and does pretend it is n= ot. If you want to understand the basic programming objects, try POSIX thread f= irst (even just by reading the manual is helpful enough) not that from C++std li= brary.=20 There are many books talk about POSIX threads in C. mess around those C cod= es, then you get the real thing.=20