Deutsch English Français Italiano |
<02aeb532b3104ab1cff46bde076b2394fb7f28dd.camel@gmail.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: wij <wyniijj5@gmail.com> Newsgroups: comp.lang.c++ Subject: Re: What is OOP? Date: Thu, 19 Dec 2024 10:32:40 +0800 Organization: A noiseless patient Spider Lines: 66 Message-ID: <02aeb532b3104ab1cff46bde076b2394fb7f28dd.camel@gmail.com> References: <d8a5a0d563f0b9b78b34711d12d4975a7941f53a.camel@gmail.com> <gog0ljdjdhdekscrcbpprte8788aerq05h@4ax.com> <OOP-20241218203833@ram.dialup.fu-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Date: Thu, 19 Dec 2024 03:32:41 +0100 (CET) Injection-Info: dont-email.me; posting-host="a3a239499efb4944c7e4fc438dced71f"; logging-data="2693869"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18LdWhL253+dlfv2Wisck6q" User-Agent: Evolution 3.54.2 (3.54.2-1.fc41) Cancel-Lock: sha1:reNz6+1yG45JhjHYUVouZzg3PDo= In-Reply-To: <OOP-20241218203833@ram.dialup.fu-berlin.de> Bytes: 4102 On Wed, 2024-12-18 at 19:42 +0000, Stefan Ram wrote: > Rosario19 <Ros@invalid.invalid> wrote or quoted: > > what is oo programming? >=20 > =C2=A0 Alan Kay coined the term, and, in 2003, I asked him: >=20 > What does "object-oriented [programming]" mean to you? >=20 > =C2=A0 . He answered in an e-mail: >=20 > > OOP to me means only messaging, local retention and protection and=20 > > hiding of state-process, and extreme late-binding of all things. >=20 > =C2=A0 . My personal interpretation (taking the above source and my > =C2=A0 own observations into account): >=20 > An object is an imaginary building block that contains states > and procedures and can only be accessed from the outside by > sending messages. The object decides how it reacts (within the > scope of its specification) to a specific message. (runtime > model) >=20 > In object-oriented programming, programs describe under which > conditions which messages are sent to object expressions at > runtime: For this purpose, there is a dispatch specification > that defines the recipient object expression and the message > to be sent. This dispatch definition can also be regarded as > an expression whose value is then determined by the recipient > object (as a type of response). (source code model)=20 >=20 > It must be possible to determine which object receives a > particular message (late binding) as late as possible (i.e. at > runtime during the evaluation of the dispatch determination): > For this purpose, the recipient object can be specified again > in the dispatch determination itself by means of an expression > that is only evaluated at runtime as late as possible (runtime > polymorphism). >=20 > =C2=A0 Yes, I really think it is better to say that we send messages > =C2=A0 to expressions because which object the expression represents > =C2=A0 is only determined shortly beforehand and can be different > =C2=A0 each time the same code is run several times. >=20 > =C2=A0 But there's something else of equal importance! It's the > =C2=A0 insight by Uncle Bob (Robert C. Martin) about when procedural > =C2=A0 code is better and when object-oriented code is better. >=20 > > 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 >=20 > > 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 Objects can be saied as variables (int,char,struct...class) Class can encapsulate almost everything. From my view, it is=C2=A0 (basically) about the rule of class's members, as in=C2=A0 ClassGuidelines.txt. The 'visible' effect is the amout of names are siginificantly=C2=A0 reduced, this means a lots.